RWDE::Exceptions - RWDE::Exceptions documentation


RWDE documentation Contained in the RWDE distribution.

Index


Code Index:

RWDE::Exceptions

Top

Exception container file, contains definitions for RWDE Exceptions

System defined exceptions are based off of the default behaviour of this base exception class

Exception class definitions for RWDE

Top

RWDE::BaseException()

new()

Override for the "new" method in the Error base class, initializes the instance the way we want.

This will return an initialized instance of Error

is_retry()

Determine whether this was a retry attempt

Exception class definitions for RWDE

Top

RWDE::DevelException()

Caught with RWDE::DevelException - developer only exceptions, typically for unplanned behaviour

RWDE::DataMissingException()

caught with RWDE::DataMissingException - missing data detected

RWDE::DataBadException()

Caught with RWDE::DataBadException - Invalid data detected

RWDE::DataLimitException()

Caught with RWDE::DataLimitException - Limit or threshold exceeded

RWDE::DataDuplicateException()

Caught with RWDE::DataDuplicateException - Discovered duplicate data (typically db related)

RWDE::DataNotFoundException()

Caught with RWDE::DataNotFoundException - Expected data does not exist

RWDE::BadPasswordException()

Caught with RWDE::BadPasswordException - Problems accepting a password

RWDE::SSLException()

Caught with RWDE::SSLException - Problems with http SSL connections

RWDE::Web::SessionMissingException()

Caught with RWDE::Web::SessionMissingException - Problem with the session occurred

RWDE::StatusException()

Caught with RWDE::StatusException - Problem with instance status

RWDE::DatabaseErrorException()

Caught with RWDE::DatabaseErrorException - Internal db problem detected

RWDE::PolicyException()

Caught with RWDE::PolicyException - Policy violation occurred

RWDE::PermissionException()

Caught with RWDE::PermissionException - Permission violation occurred

RWDE::DefaultException()

Caught with RWDE::DefaultException - Default Exception - undefined exceptions are funnelled here


RWDE documentation Contained in the RWDE distribution.
package RWDE::Exceptions;

use vars qw($VERSION);
$VERSION = sprintf "%d", q$Revision: 515 $ =~ /(\d+)/;

package RWDE::BaseException;

use strict;
use warnings;

use RWDE::DB::DbRegistry;

use base qw(Error);

use overload ('""' => 'stringify');

sub new {
  my ($proto, $params) = @_;

  my $class = ref($proto) || $proto;

  my $info  = defined $$params{info} ? $$params{info} : 'none';
  my $value = defined $$params{value} ? $$params{info} : 'none';

  if (defined $$params{abort_transaction}) {
    RWDE::DB::DbRegistry->abort_transaction();
  }

  local $Error::Depth = $Error::Depth + 1;
  local $Error::Debug = 1;                   # Enables storing of stacktrace

  my $exception = $class->SUPER::new(-text => $info, -value => $value);

  return $exception;
}

sub is_retry {
  my ($self) = @_;

  return $self->{'-value'} =~ m/retry/ig;
}

1;

package RWDE::DevelException;
use base qw(RWDE::BaseException);

1;

package RWDE::DataMissingException;
use base qw(RWDE::BaseException);
1;

package RWDE::DataBadException;
use base qw(RWDE::BaseException);
1;

package RWDE::DataLimitException;
use base qw(RWDE::BaseException);
1;

package RWDE::DataDuplicateException;
use base qw(RWDE::BaseException);
1;

package RWDE::DataNotFoundException;
use base qw(RWDE::BaseException);
1;

package RWDE::BadPasswordException;
use base qw(RWDE::BaseException);
1;

package RWDE::SSLException;
use base qw(RWDE::BaseException);
1;

package RWDE::Web::SessionMissingException;
use base qw(RWDE::BaseException);
1;

package RWDE::StatusException;
use base qw(RWDE::BaseException);
1;

package RWDE::DatabaseErrorException;
use base qw(RWDE::BaseException);
1;

package RWDE::PolicyException;
use base qw(RWDE::BaseException);
1;

package RWDE::PermissionException;
use base qw(RWDE::BaseException);
1;

package RWDE::DefaultException;
use base qw(RWDE::BaseException);
1;