The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Data::Object::Exception

ABSTRACT

Data-Object Exception Class

SYNOPSIS

  use Data::Object::Exception;

  my $exception = Data::Object::Exception->new;

  $exception->throw('Something went wrong');

DESCRIPTION

Data::Object::Exception provides functionality for creating, throwing, catching, and introspecting exception objects.

METHODS

This package implements the following methods.

data

  data() : Any

data

data example
  my $data = $exception->data();

dump

  dump() : Str

The dump method returns a string representation of the underlying data.

dump example
  my $dump = $exception->dump();

explain

  explain() : Str

Returns a complete stack trace if the exception was thrown.

explain example
  my $explain = $exception->explain();

throw

  throw(Str $arg1) : Object

Throw error with object and message.

throw example
  $exception->throw();