Data::Object::Role::Throwable
Throwable Role for Perl 5
package Example; use Moo; with 'Data::Object::Role::Throwable'; package main; my $example = Example->new; # $example->throw
This package provides mechanisms for throwing the object as an exception.
This package implements the following methods:
throw(Tuple[Str, Str] | Str $message, Maybe[Number] $offset) : Any
The throw method throws an exception with the object and the given message. The object is thrown as the exception context. See Data::Object::Exception for more information.
# given: synopsis $example->throw('Oops!');
# given: synopsis $example->throw(['E001', 'Oops!']);
Al Newkirk, awncorp@cpan.org
awncorp@cpan.org
Copyright (C) 2011-2019, Al Newkirk, et al.
This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".
Wiki
Project
Initiatives
Milestones
Contributing
Issues
To install Data::Object::Role::Throwable, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Object::Role::Throwable
CPAN shell
perl -MCPAN -e shell install Data::Object::Role::Throwable
For more information on module installation, please visit the detailed CPAN module installation guide.