NAME
Data::Object::Exception
ABSTRACT
Exception Class for Perl 5
SYNOPSIS
DESCRIPTION
This package provides functionality for creating, throwing, and introspecting exception objects.
SCENARIOS
This package supports the following scenarios:
args-1
my
$exception
= Data::Object::Exception->new(
'Oops!'
);
# $exception->throw
The package allows objects to be instantiated with a single argument.
args-kv
my
$exception
= Data::Object::Exception->new(
message
=>
'Oops!'
);
# $exception->throw
The package allows objects to be instantiated with key-value arguments.
ATTRIBUTES
This package has the following attributes:
context
context(Any)
This attribute is read-only, accepts (Any)
values, and is optional.
id
id(Str)
This attribute is read-only, accepts (Str)
values, and is optional.
message
message(Str)
This attribute is read-only, accepts (Str)
values, and is optional.
METHODS
This package implements the following methods:
explain
explain() : Str
The explain method returns an error message with stack trace.
throw
throw(Tuple[Str, Str] | Str
$message
, Any
$context
, Maybe[Number]
$offset
) : Any
The throw method throws an error with message (and optionally, an ID).
trace
trace(Int
$offset
,
$Int
$limit
) : Object
The trace method compiles a stack trace and returns the object. By default it skips the first frame.
AUTHOR
Al Newkirk, awncorp@cpan.org
LICENSE
Copyright (C) 2011-2019, Al Newkirk, et al.
This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".