Net::SAJAX::Exception - Basic exception object for Net::SAJAX


Net-SAJAX documentation  | view source Contained in the Net-SAJAX distribution.

Index


NAME

Top

Net::SAJAX::Exception - Basic exception object for Net::SAJAX

VERSION

Top

This documentation refers to Net::SAJAX::Exception version 0.106

SYNOPSIS

Top

  use Net::SAJAX::Exception;

  Net::SAJAX::Exception->throw(
    message => 'This is some error message',
  );

DESCRIPTION

Top

This is a basic exception class for the Net::SAJAX library.

ATTRIBUTES

Top

message

Required. This is a string that contains the error message for the exception.

METHODS

Top

stringify

This method is used to return a string that will be given when this object is used in a string context. Classes inheriting from this class are welcome to override this method. By default (as in, in this class) this method simply returns the contents of the message attribute.

  my $error = Net::SAJAX::Exception->new(message => 'Error message');

  print $error; # Prints "Error message"

throw

This method will take a HASH as the argument and will pass this HASH to the constructor of the class, and then throw the newly constructed object. An extra option that will be stripped is class. This option will actually construct a different class, where this class is in the package space below the specified class.

  eval {
    Net::SAJAX::Exception->throw(
      class   => 'ClassName',
      message => 'An error occurred',
    );
  };

  print ref $@; # Prints Net::SAJAX::Exception::ClassName

DEPENDENCIES

Top

* Carp
* English
* Moose 0.77
* MooseX::StrictConstructor 0.08
* namespace::clean 0.04

AUTHOR

Top

Douglas Christopher Wilson, <doug at somethingdoug.com>

BUGS AND LIMITATIONS

Top

Please report any bugs or feature requests to bug-net-sajax at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-SAJAX. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

I highly encourage the submission of bugs and enhancements to my modules.

LICENSE AND COPYRIGHT

Top


Net-SAJAX documentation  | view source Contained in the Net-SAJAX distribution.