Hello,
(1) That error (line #156, CGI::Application 2.4) only happens when you
map
your run modes like so:
'select_document', = 'select_document',
but will not occur if the run mode is directly mapped (this holds the
method to the current package I believe.)
'select_document', = \select_document,
Thanks for the hint, that would have worked for me.
But note that this part has changed in CGI::Application 2.6.
It is now:
# Process run mode!
my $body = eval { $autoload_mode ? $self-$rmeth($rm) :
$self-$rmeth()};
die Error executing run mode '$rm': $@ if $@;
So, it will eval and die (in a way useless to me) in both cases.
(2) You _might_ be able to modify the suggested code (in the above
mailing
list reference) to place that data INTO the hash, and then directly
propagate that error. In my other post, I suggest :
die ($@ . Error executing run mode '$rm'. Eval of code '$meth_call'
resulted in error.) if ($@);
For you to keep your hashref exception object intact, you could
die ( $@ ) if ($@);
Yes, this is what I do now.
But I am not happy with overloading (and duplicating) the whole run()
method to just change a single line.
I really think the cleanest way is to have the additional callback
method cgiapp_exception.
===
PATCH REQUEST
# Process run mode!
my $body = eval { $autoload_mode ? $self-$rmeth($rm) :
$self-$rmeth()};
die $self-cgiapp_exception($rm, $@);
Default would be
sub cgiapp_exception{
my ($self, $rm, $exception) = @_;
die Error executing run mode '$rm': $exception;
}
==
Cory would have used
sub cgiapp_exception{
my ($self, $rm, $exception) = @_;
die $exception Error executing run mode '$rm'. ;
}
I would use
sub cgiapp_exception{
my ($self, $rm, $exception) = @_;
# exception handling
}
Jesse, can I please have this method ?
I can pay with a postcard from Tokyo ;-)
Cheers,
Thilo
PS: patch file for 2.6 attached
cgiapp_exception.patch
Description: application/text
-
Web Archive: http://www.mail-archive.com/cgiapp;lists.vm.com/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]