Activator

 view release on metacpan or  search on metacpan

lib/Activator/Exception.pm  view on Meta::CPAN

package Activator::Exception;

use warnings;
use strict;

# override throw to accept shortcut
sub throw {
    my ( $pkg, $obj, $code, $extra ) = @_;
    $pkg->SUPER::throw( error => $obj,
			code => $code,
			extra => $extra );
}

# TODO: make this thing do dictionary/lexicon lookups, with support in
# $extra as well. Maybe $extra could "dict-><key>".

# TODO: make this take 2 args, update all of Activator

# NOTE: this is always called from SUPER::as_string
sub full_message {
    my $self = shift;

    my $msg = $self->description .': ' . $self->error;
    my $code  = $self->code;
    my $extra = $self->extra;
    $msg .= " $code" if $code;
    $msg .= " $extra" if $extra;
    return $msg;
}



( run in 0.448 second using v1.01-cache-2.11-cpan-49f99fa48dc )