Name

IPC::SRLock::Exception - Exception class

Version

This documents version v0.12.$Rev: 1 $

Synopsis

use IPC::SRLock::Exception;

IPC::SRLock::Exception->throw( 'This is going to die' );

Description

Implements throw and catch error semantics. Inherits from Unexpected

Configuration and Environment

Overrides the class attribute setting it's value to this class

Defines these attributes;

class

Overrides the default value with this package name

out

A string containing the output from whatever was being called before it threw

Subroutines/Methods

as_string

$printable_string = $e->as_string

What an instance of this class stringifies to

caught

$e = IPC::SRLock::Exception->caught( $error );

Catches and returns a thrown exception or generates a new exception if EVAL_ERROR has been set or if an error string was passed in

stacktrace

$lines = $e->stacktrace( $num_lines_to_skip );

Return the stack trace. Defaults to skipping zero lines of output Skips anonymous stack frames, minimalist

throw

IPC::SRLock::Exception->throw( $error );

Create (or re-throw) an exception to be caught by the "caught" method. If the passed parameter is a reference it is re-thrown. If a single scalar is passed it is taken to be an error message code, a new exception is created with all other parameters taking their default values. If more than one parameter is passed the it is treated as a list and used to instantiate the new exception. The error attribute must be provided in this case

throw_on_error

IPC::SRLock::Exception->throw_on_error( $error );

Calls "caught" and if the was an exception "throw"s it

Diagnostics

None

Dependencies

Moo
Unexpected

Incompatibilities

There are no known incompatibilities in this module

Bugs and Limitations

There are no known bugs in this module. The default ignore package list should be configurable. Please report problems to the address below. Patches are welcome

Author

Peter Flanigan, <pjfl@cpan.org>

License and Copyright

Copyright (c) 2013 Peter Flanigan. All rights reserved

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic

This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE