| Test-Able documentation | Contained in the Test-Able distribution. |
Test::Able::FatalException - Fatal Exception Class
Test::Able::FatalException->throw->( 'get me outta here - for real!' );
Test::Able has special exception handling for the test-related methods.
This exception class is a means for breaking out of Test::Able's exception smothering.
See on_method_exception in Test::Able::Role::Meta::Class and method_exceptions in Test::Able::Role::Meta::Class for details.
The text of the exception.
Standard Moose BUILDARGS method to allow single parameter construction.
Main method used to construct and throw an exception object.
Justin DeVuyst, justin@devuyst.com
Copyright 2009 by Justin DeVuyst.
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
| Test-Able documentation | Contained in the Test-Able distribution. |
package Test::Able::FatalException; use Moose; use overload '""' => sub { return shift->message; }, fallback => 1; use strict; use warnings;
has 'message' => ( is => 'rw', isa => 'Str', default => '', );
sub BUILDARGS { my $class = shift; if ( @_ == 1 ) { return { message => $_[ 0 ], }; } else { return { @_ }; }; }
sub throw { my $class = shift; die $class->new( @_, ); }
1;