Venus::Fault - Fault Class
Fault Class for Perl 5
package main; use Venus::Fault; my $fault = Venus::Fault->new; # $fault->throw;
This package represents a generic system error (exception object).
This package provides the following methods:
explain() (Str)
The explain method returns the error message and is used in stringification operations.
Since 1.80
1.80
# given: synopsis; my $explain = $fault->explain; # "Exception! in ...
frames() (ArrayRef)
The frames method returns the compiled and stashed stack trace data.
# given: synopsis; my $frames = $fault->frames; # [ # ... # [ # "main", # "t/Venus_Fault.t", # ... # ], # ]
throw(Str $message) (Fault)
The throw method throws an error if the invocant is an object, or creates an error object using the arguments provided and throws the created object.
# given: synopsis; my $throw = $fault->throw; # bless({ ... }, 'Venus::Fault')
trace(Int $offset, Int $limit) (Fault)
The trace method compiles a stack trace and returns the object. By default it skips the first frame.
# given: synopsis; my $trace = $fault->trace; # bless({ ... }, 'Venus::Fault')
# given: synopsis; my $trace = $fault->trace(0, 1); # bless({ ... }, 'Venus::Fault')
# given: synopsis; my $trace = $fault->trace(0, 2); # bless({ ... }, 'Venus::Fault')
This package overloads the following operators:
(eq)
This package overloads the eq operator.
eq
example 1
# given: synopsis; my $result = $fault eq 'Exception!'; # 1
(ne)
This package overloads the ne operator.
ne
# given: synopsis; my $result = $fault ne 'exception!'; # 1
(qr)
This package overloads the qr operator.
qr
# given: synopsis; my $test = 'Exception!' =~ qr/$fault/; # 1
("")
This package overloads the "" operator.
""
# given: synopsis; my $result = "$fault"; # "Exception!"
(~~)
This package overloads the ~~ operator.
~~
# given: synopsis; my $result = $fault ~~ 'Exception!'; # 1
Awncorp, awncorp@cpan.org
awncorp@cpan.org
Copyright (C) 2000, Al Newkirk.
This program is free software, you can redistribute it and/or modify it under the terms of the Apache license version 2.0.
To install Venus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Venus
CPAN shell
perl -MCPAN -e shell install Venus
For more information on module installation, please visit the detailed CPAN module installation guide.