Carp-Proxy
view release on metacpan or search on metacpan
lib/Carp/Proxy.pm view on Meta::CPAN
list is evaluated once for each package in the
L<handler_pkgs|/handler_pkgs> attribute.
<package>::_cp_<handler_name>
<package>::_<handler_name>
<package>::<handler_name>
=item B<5 - Call Handler>
The Handler is called with the object as the first argument. Any
arguments passed to the Proxy, beyond the handler-name, are propagated as
additional arguments to the Handler.
=item B<6 - Add Calling Context (Stacktrace)>
The method L<add_context()|/add_context> is invoked to generate a
Section with stacktrace content, as dictated by the
L<context|/context> attribute.
=item B<7 - Call end_hook>
The L<end_hook|/end_hook> attribute, if it exists, is called,
passing the object as the only argument.
=item B<8 - Perform Disposition>
The method L<perform_disposition()|/perform_disposition> is
invoked. Disposition is controlled by the
L<disposition|/disposition> attribute; typically this means
passing the B<Carp::Proxy> object to B<die()>.
=back
If L<perform_disposition()|/perform_disposition> returns, rather
than throwing, then the returned value is propagated as the return value
of the Proxy.
=head1 ATTRIBUTES
All B<Carp::Proxy> object attributes have correspondingly named accessors.
When the accessors are invoked without arguments, they return the
attribute's value. Mutable (Read-Write) attributes have accessors that can
be supplied with an argument to set the attribute's value.
Users generally do not create B<Carp::Proxy> objects directly; the Proxy
does that for them. The object constructor, L<new()|/new>, requires
specification for several of the attributes like
L<eval_error|/eval_error>. The Proxy supplies these required
attributes, but arguments to B<use()> or L<import()|/import> can override them.
All other attributes invoke a "builder" method to initialize the
attribute value if one is not provided. Builder
methods are named with a prefix of B<'_build_'>. You can change default
values for these attributes with arguments to B<use()> / L<import()|/import>,
or by providing custom builder functions in a sub-class.
=head2 arg
I<arg> holds the value of Perl's B<$ARG ($_)>, as harvested from the
invoking environment. This can be handy if you are using
B<Try::Tiny>.
=over 4
=item Builder: None; L<new()|/new> requires I<arg> specification.
=item Default: N/A
=item Domain: Any
=item Affects: For user convenience; not used by B<Carp::Proxy>
=item Mutability: Read-Only
=back
=head2 as_yaml
The I<as_yaml> attribute is a flag that controls message rendering.
When False, message text is derived from the
L<sections|/sections> attribute; this is the normal mode of
operation.
When I<as_yaml> is True message text is a B<YAML::Dump()> of the
B<Carp::Proxy> object. Serialization via YAML makes it possible to
propagate exceptions up from child processes. See the section on
L<PROPAGATION|/PROPAGATION>.
=over 4
=item Builder: _build_as_yaml()
=item Default: 0 (False)
=item Domain: Boolean
=item Affects: L<render_message()|/render_message>
=item Mutability: Read-Write
=back
=head2 banner_title
The Banner is the first part of the message; I<banner_title> contains the
first word(s) in the Banner.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fatal << handler name >>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----
\
+------ banner_title
=over 4
=item Builder: _build_banner_title()
=item Default: 'Fatal'
=item Domain: String
( run in 2.291 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )