NAME

Storage::Abstract::X - Exceptions for Storage::Abstract

SYNOPSIS

try {
	my $fh = $storage->retrieve('some/file');
}
catch ($e) {
	# $e is (usually) one of subclasses of Storage::Abstract::X
}

DESCRIPTION

This is a small exception module for Storage::Abstract. It can stringify automatically and keeps a "caller" and a "message".

Subclasses

NotFound

This exception is raised when a file is not found.

PathError

This exception is raised when a path passed in a method call is not well formed.

HandleError

This exception is raised when there is a problem with the handle passed to a method call or created from data passed to a method call.

StorageError

This exception is raised when a problem occurs with the underlying file storage.

INTERFACE

Attributes

message

Required - Human-readable description of the problem.

caller

A three-element array as returned by caller Perl function. The module will try to find a caller most useful to the user - if it fails, this attribute will be undef.

It cannot be used in the constructor.

Methods

new

$ex = Storage::Abstract::X::NotFound->new(%args)

Moose-flavored constructor.

raise

Storage::Abstract::X::NotFound->raise($message)
$ex->raise;

Same as calling die $class->new(message => $message). If there is no $message then it must be called on an object instance.

as_string

$string = $ex->as_string()

Method used to stringify the exception.