Venus::Throw

Throw Class

Throw Class for Perl 5

method: die method: error method: new

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::Error

The package attribute is read-write, accepts (string) values, and is optional.

package(string $package) (string)

{ since => '4.15', }

The parent attribute is read-write, accepts (string) values, and is optional.

parent(string $parent) (string)

{ since => '4.15', }

The die method builds an error object from the attributes set on the invocant and throws it.

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

{ since => '4.15', }

=example-1 die

# given: synopsis;

my $die = $throw->die;

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

The error method builds an error object from the attributes set on the invocant and returns or optionally automatically throws it.

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 new method constructs an instance of the package.

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

{ since => '4.15', }

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

41 POD Errors

The following errors were encountered while parsing the POD:

Around line 14:

Unknown directive: =name

Around line 22:

Unknown directive: =tagline

Around line 30:

Unknown directive: =abstract

Around line 38:

Unknown directive: =includes

Around line 48:

Unknown directive: =synopsis

Around line 67:

Unknown directive: =description

Around line 76:

Unknown directive: =inherits

Around line 84:

Unknown directive: =attribute

Around line 89:

Unknown directive: =signature

Around line 93:

Unknown directive: =metadata

Around line 111:

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

Around line 133:

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

Around line 143:

Unknown directive: =attribute

Around line 148:

Unknown directive: =signature

Around line 152:

Unknown directive: =metadata

Around line 170:

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

Around line 192:

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

Around line 202:

Unknown directive: =method

Around line 207:

Unknown directive: =signature

Around line 211:

Unknown directive: =metadata

Around line 257:

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

Around line 286:

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

Around line 320:

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

Around line 358:

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

Around line 391:

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

Around line 419:

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

Around line 433:

Unknown directive: =method

Around line 438:

Unknown directive: =signature

Around line 442:

Unknown directive: =metadata

Around line 488:

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

Around line 517:

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

Around line 551:

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

Around line 589:

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

Around line 622:

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

Around line 650:

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

Around line 664:

Unknown directive: =method

Around line 668:

Unknown directive: =signature

Around line 672:

Unknown directive: =metadata

Around line 690:

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

Around line 710:

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

Around line 723:

Unknown directive: =partials