.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Throwable::Error 3" .TH Throwable::Error 3 2026-04-21 "perl v5.42.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 4 \& package MyApp::Error; \& # NOTE: Moo can also be used here instead of Moose \& use Moose; \& extends \*(AqThrowable::Error\*(Aq; \& \& has execution_phase => ( \& is => \*(Aqro\*(Aq, \& isa => \*(AqMyApp::Phase\*(Aq, \& default => \*(Aqstartup\*(Aq, \& ); .Ve .PP \&...and in your app... .PP .Vb 1 \& MyApp::Error\->throw("all communications offline"); \& \& # or... \& \& MyApp::Error\->throw({ \& message => "all communications offline", \& execution_phase => \*(Aqshutdown\*(Aq, \& }); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Throwable::Error is a base class for exceptions that will be thrown to signal errors and abort normal program flow. Throwable::Error is an alternative to Exception::Class, the features of which are largely provided by the Moo object system atop which Throwable::Error is built. .PP Throwable::Error performs the Throwable and StackTrace::Auto roles. That means you can call \f(CW\*(C`throw\*(C'\fR on it to create and throw an error object in one call, and that every error object will have a stack trace for its creation. .PP This attribute must be defined and must contain a string describing the error condition. This string will be printed at the top of the stack trace when the error is stringified. .PP This attribute, provided by StackTrace::Auto, will contain a stack trace object guaranteed to respond to the \f(CW\*(C`as_string\*(C'\fR method. For more information about the stack trace and associated behavior, consult the StackTrace::Auto docs. .PP This method will provide a string representing the error, containing the error\*(Aqs message followed by the its stack trace. .SH "POD ERRORS" .IX Header "POD ERRORS" Hey! \fBThe above document had some coding errors, which are explained below:\fR .IP "Around line 49:" 4 .IX Item "Around line 49:" Unknown directive: =attr .IP "Around line 66:" 4 .IX Item "Around line 66:" Unknown directive: =attr .IP "Around line 73:" 4 .IX Item "Around line 73:" Unknown directive: =method