The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WWW::SFDC::Role::Exception - Exception role for WWW::SFDC libraries

VERSION

version 0.36

SYNOPSIS

    package MyException;
    use Moo;
    with 'WWW::SFDC::Role::Exception';

    has 'something', is => 'ro', default => 'value';

    package MAIN;
    # Simple:
    MyException->throw(message => 'Something bad happened!');


    # More complex:
    my $e = MyException->new(message => 'Something bad happened!');
    print $e; # Something bad happened! (not HASH(...))
    eval {
        $e->throw();
    }
    print $@->something; # value

ATTRIBUTES

message

The exception message. When this object is stringified, this will be the value returned.

METHODS

throw

This will log the message using Log4perl then die with itself as the error value. This enables catching the error and determining whether it's recoverable, or whether the values need using. This is intended for doing things like getting the debug log from a failed ExecuteAnonymous, or unit test results from a failed deployment.

BUGS

Please report any bugs or feature requests at https://github.com/sophos/WWW-SFDC/issues.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc WWW::SFDC::Role::Exception

You can also look for information at https://github.com/sophos/WWW-SFDC

AUTHOR

Alexander Brett <alexander.brett@sophos.com> http://alexander-brett.co.uk

COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by Sophos Limited https://www.sophos.com/.

This is free software, licensed under:

  The MIT (X11) License

The full text of the license can be found in the LICENSE file included with this distribution.