The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Pangloss::StoredObject::Error - base class for stored object errors.

SYNOPSIS

  # abstract - cannot be used directly
  package SomeError;
  use base qw( Pangloss::StoredObject::Error );

  throw SomeError( flag => eExists, ... );
  throw SomeError( flag => eNonExistent, ... );
  throw SomeError( flag => eInvalid, invalid => { ... });

  # with caught errors:
  print $e->flag;
  do { ... } if $e->isExists;
  do { ... } if $e->isNonexistent;
  do { ... } if $e->isInvalid;

DESCRIPTION

Stored Object Errors class. Inherits interface from Pangloss::Error. Introduces validation error flags.

EXPORTED FLAGS

Error flags: eExists eInvalid eNonExistent

Validation errors: eNameRequired eCreatorRequired eDateRequired

METHODS

$e->invalid

set/get hash of validation error flags.

$bool = $e->is( $flag )

Test if this error's flag is equal to $flag. if this is a validation error also checks in the $e->invalid hash for $flag.

$bool = $e->isInvalid, $e->isExists, $e->isNonExistent, $e->isNameRequired, $e->isCreatorRequired, $e->isDateRequired

Test if this error's flag is equal to the named flag.

TODO

Refactor some of this out to OpenFrame::WebApp.

Write name(), date(), and creator() shortcuts to see if flag is associated with the given instance variable.

AUTHOR

Steve Purkis <spurkis@quiup.com>

SEE ALSO

Pangloss::Error, Pangloss::StoredObject::Common