On 2004-03-23, suppressed <suppressed> wrote:
> I have what looks like a fairly simple problem. I have a run mode and
> this run mode calls a utility method. The utility method might throw an
> error, but the error is fixable. I want my utility method to see if it has an
> error and then switch to a specific error run mode to fix the error. The
> problem is, of course, I can't switch run modes from my utility method,
> the only place I can switch is from the cgiapp_prerun method. Whats
> the best way to hack around this problem?
One alternative is:
eval { utility_func(); };
return $self->error_page($@) if $@;
Your utility function can die if there is a problem.
You can catch that and pass the resulting message to an
error page routine.
Mark
--
http://mark.stosberg.com/
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.