eval {
$form->parse_template(\%::myconfig);
1;
- } || die $EVAL_ERROR->{error};
+ } || die $EVAL_ERROR->getMessage;
});
}
use SL::OE;
use SL::Template;
use SL::User;
+use SL::X;
use Template;
use URI;
use List::Util qw(first max min sum);
sub throw_on_error {
my ($self, $code) = @_;
- local $self->{__ERROR_HANDLER} = sub { die({ error => $_[0] }) };
+ local $self->{__ERROR_HANDLER} = sub { die SL::X::FormError->new($_[0]) };
$code->();
}
--- /dev/null
+package SL::X;
+
+use strict;
+
+use Exception::Lite qw(declareExceptionClass);
+
+declareExceptionClass('SL::X::FormError');
+
+1;