MooseX::Method::Exception - Exception class for MooseX::Method


MooseX-Method documentation  | view source Contained in the MooseX-Method distribution.

Index


NAME

Top

MooseX::Method::Exception - Exception class for MooseX::Method

WARNING

Top

This API is unstable, it may change at any time. This should not affect ordinary MooseX::Method usage.

SYNOPSIS

Top

  eval {
    MooseX::Method::Exception->throw ("OH NOES!");
  };

  if ($@) {
    if (blessed $@ && $@->isa ('MooseX::Method::Exception') {
      # Our exception
    } else {
      # Something else
    }
  }

DESCRIPTION

Top

To get MooseX::Method to treat your exceptions like its own, use this class to throw exceptions in the validation.

ATTRIBUTES

Top

error

The error message.

METHODS

Top

throw

Shorthand for...

  my $exception = MooseX::Method::Exception->new (error => $message);

  die $exception;

Takes a single argument, the error message.

rethrow

Rethrows an existing exception.

stringify

Makes the exception object stringify to the error message in a string context.

BUGS

Top

Most software has bugs. This module probably isn't an exception. If you find a bug please either email me, or add the bug to cpan-RT.

AUTHOR

Top

Anders Nor Berle <debolaz@gmail.com>

COPYRIGHT AND LICENSE

Top


MooseX-Method documentation  | view source Contained in the MooseX-Method distribution.