|
NAMEData::Object::Role::ErrableABSTRACTErrable Role for Perl 5SYNOPSISpackage Example; use Moo; with 'Data::Object::Role::Errable'; package main; my $example = Example->new; # $example->error('Oops!') DESCRIPTIONThis package provides a mechanism for handling errors (exceptions). It's a more structured approach to being "throwable". The idea is that any object that consumes this role can set an error which automatically throws an exception which if trapped includes the state (object as thrown) in the exception context.INTEGRATESThis package integrates behaviors from:Data::Object::Role::Tryable LIBRARIESThis package uses type constraints from:Data::Object::Types ATTRIBUTESThis package has the following attributes:errorerror(ExceptionObject) This attribute is read-write, accepts "(ExceptionObject)" values, and is optional. METHODSThis package implements the following methods:errorerror(ExceptionObject $exception | HashRef $options | Str $message) : ExceptionObject The error method takes an error message (string) or hashref of exception object constructor attributes and throws an "exception". If the exception is trapped the exception object will contain the object as the exception context. The original object will also have the exception set as the error attribute. The error attribute can be cleared using the "error_reset" method.
error_reseterror_reset() : Any The error_reset method clears any exception object set on the object.
AUTHORAl Newkirk, "awncorp@cpan.org"LICENSECopyright (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" <https://github.com/iamalnewkirk/data-object-role-errable/blob/master/LICENSE>. PROJECTWiki <https://github.com/iamalnewkirk/data-object-role-errable/wiki>Project <https://github.com/iamalnewkirk/data-object-role-errable> Initiatives <https://github.com/iamalnewkirk/data-object-role-errable/projects> Milestones <https://github.com/iamalnewkirk/data-object-role-errable/milestones> Contributing <https://github.com/iamalnewkirk/data-object-role-errable/blob/master/CONTRIBUTE.md> Issues <https://github.com/iamalnewkirk/data-object-role-errable/issues>
Visit the GSP FreeBSD Man Page Interface. |