in reply to Re: Moose | How to identify subroutine inside an 'around' in case multiple subroutine share the same 'around'?
in thread Moose | How to identify subroutine inside an 'around' in case multiple subroutine share the same 'around'?

I am not very sure about the first point. If you meant sub-classing Exception then that's what I have. Different Exceptions (subclass of Exception) to throw for different subroutines.

Regarding second point "allow for a parameter to be sent to the exception handling routine"; It has the same problem parameter will depend on subroutine. But you have a good point that it could be retrieved from the object itself (Why I didn't think it :-(. May be I was obsessed with the thought to get something out of Moose itself.).

Regards,
Ashish
  • Comment on Re^2: Moose | How to identify subroutine inside an 'around' in case multiple subroutine share the same 'around'?

Replies are listed 'Best First'.
Re^3: Moose | How to identify subroutine inside an 'around' in case multiple subroutine share the same 'around'?
by locked_user sundialsvc4 (Abbot) on Aug 10, 2010 at 03:32 UTC

    In the case of the first point:   the idea here is that, in order to raise an exception, the base-class will call one of its methods.   The descendant classes will then override those methods.   Hence, each descendant class can arrange to throw a particular Exception ... and/or to otherwise distinguish their response from everybody else’s.

    In the case of the second point:   well, it is extremely easy indeed, when faced with the obstacle of a thick iron door, to focus your entire attention upon how to drill through that door ... and, thus, to completely overlook the fact that the door is set into a wooden wall, next to an open window.   (Believe me, it happens to all of us.   That's why Homer Simpson is always whacking himself on the forehead and saying:   “Doh!!”)