Venus::Throw

Throw Class

Throw Class for Perl 5

method: as method: error method: on

package main;

use Venus::Throw;

my $throw = Venus::Throw->new;

# $throw->error;

This package provides a mechanism for generating and raising errors (exception objects).

Venus::Kind::Utility

Venus::Role::Stashable

frame: rw, opt, Int name: rw, opt, Str message: rw, opt, Str package: ro, opt, Str parent: ro, opt, Str, 'Venus::Error' context: ro, opt, Str

The as method sets a "name" for the error and returns the invocant.

as(string $name) (Venus::Throw)

{ since => '2.55', }

The capture method captures the caller info at the "frame" specified, in the object stash, and returns the invocant.

capture(any @args) (Venus::Throw)

{ since => '2.55', }

The error method throws the prepared error object.

error(hashref $data) (Venus::Error)

{ since => '0.01', }

=example-1 error

# given: synopsis;

my $error = $throw->error;

# bless({
#   ...,
#   "context"  => "(eval)",
#   "message"  => "Exception!",
# }, "Main::Error")

The on method sets a "name" for the error in the form of "on.$subroutine.$name" or "on.$name" (if outside of a subroutine) and returns the invocant.

on(string $name) (Venus::Throw)

{ since => '2.55', }

This package overloads the "" operator.

This package overloads the ~~ operator.

t/Venus.t: present: authors t/Venus.t: present: license

36 POD Errors

The following errors were encountered while parsing the POD:

Around line 13:

Unknown directive: =name

Around line 21:

Unknown directive: =tagline

Around line 29:

Unknown directive: =abstract

Around line 37:

Unknown directive: =includes

Around line 47:

Unknown directive: =synopsis

Around line 66:

Unknown directive: =description

Around line 75:

Unknown directive: =inherits

Around line 83:

Unknown directive: =integrates

Around line 91:

Unknown directive: =attributes

Around line 104:

Unknown directive: =method

Around line 108:

Unknown directive: =signature

Around line 112:

Unknown directive: =metadata

Around line 130:

=cut found outside a pod block. Skipping to next block.

Around line 141:

Unknown directive: =method

Around line 146:

Unknown directive: =signature

Around line 150:

Unknown directive: =metadata

Around line 168:

=cut found outside a pod block. Skipping to next block.

Around line 181:

Unknown directive: =method

Around line 185:

Unknown directive: =signature

Around line 189:

Unknown directive: =metadata

Around line 235:

=cut found outside a pod block. Skipping to next block.

Around line 264:

=cut found outside a pod block. Skipping to next block.

Around line 298:

=cut found outside a pod block. Skipping to next block.

Around line 336:

=cut found outside a pod block. Skipping to next block.

Around line 368:

=cut found outside a pod block. Skipping to next block.

Around line 396:

=cut found outside a pod block. Skipping to next block.

Around line 410:

Unknown directive: =method

Around line 416:

Unknown directive: =signature

Around line 420:

Unknown directive: =metadata

Around line 442:

=cut found outside a pod block. Skipping to next block.

Around line 471:

=cut found outside a pod block. Skipping to next block.

Around line 482:

Unknown directive: =operator

Around line 498:

=cut found outside a pod block. Skipping to next block.

Around line 508:

Unknown directive: =operator

Around line 524:

=cut found outside a pod block. Skipping to next block.

Around line 530:

Unknown directive: =partials