Discussion:
[Mason-devel] HTML::Mason::Exception handler <%method> ?
C.J. Adams-Collier
2008-03-12 20:09:57 UTC
Permalink
Hey folks,

We would like to start throwing and handling exceptions to determine the
service responsible for causing content problems.

Is it possible to specify a <%method> as a catch block for any
exceptions thrown within a given lexical scope?

Cheers,

C.J.
Scott Lanning
2008-03-13 08:59:13 UTC
Permalink
[this is more for mason-users, n'est-ce pas?]
Post by C.J. Adams-Collier
We would like to start throwing and handling exceptions to determine
the service responsible for causing content problems.
Is it possible to specify a <%method> as a catch block for any
exceptions thrown within a given lexical scope?
If by "lexical scope" you could mean "component",
then there's HTML::Mason::Plugin whose end_component_hook
can access exceptions thrown during the eval of a component
(or at the end_request_hook level).

For a more general "lexical scope", I guess you could wrap
eval { ... } around the scope and send any $@ to the %method
in the normal ways.
C.J. Adams-Collier
2008-03-13 16:54:36 UTC
Permalink
D'oh. I realized that shortly into writing it, subscribed to the list
and then forgot to change the to: line. My apologies.
Post by Scott Lanning
[this is more for mason-users, n'est-ce pas?]
Post by C.J. Adams-Collier
We would like to start throwing and handling exceptions to determine
the service responsible for causing content problems.
Is it possible to specify a <%method> as a catch block for any
exceptions thrown within a given lexical scope?
If by "lexical scope" you could mean "component",
then there's HTML::Mason::Plugin whose end_component_hook
can access exceptions thrown during the eval of a component
(or at the end_request_hook level).
For a more general "lexical scope", I guess you could wrap
in the normal ways.
Loading...