develooper Front page | perl.perl6.users | Postings from October 2018

Re: Appropriate last words

Thread Previous | Thread Next
From:
Elizabeth Mattijsen
Date:
October 21, 2018 09:33
Subject:
Re: Appropriate last words
Message ID:
9AC5E7CB-2068-4FEB-9F53-8859144BA7FE@dijkmat.nl
I’m not sure what you mean by: "How do I attach a default CATCH to all methods in the class.”.  What are you trying to achieve?

> On 21 Oct 2018, at 10:35, Richard Hainsworth <rnhainsworth@gmail.com> wrote:
> 
> This sounds great.
> 
> So I am writing a class verifies conditions, and dies when conditions are not met.
> 
> How do I attach a default CATCH to all methods in the class. 
> Or do I need to define my own Exception. 
> 
> On 04/09/18 04:48, Curt Tilmes wrote:
>> 
>> 
>> On Mon, Sep 3, 2018 at 4:28 PM Parrot Raiser <1parrota@gmail.com> wrote:
>> If I understand that correctly, "die" needs to be documented as always
>> outputting the line number, and that for user-oriented messages, one
>> of the other techniques should be used.
>> 
>> die throws the Exception -- you can CATCH it and handle it how you like, including printing the message without line numbers.
>> 
>> (Or, for example, print the backtrace during development, but a simpler error message in operations).
>> 
>> 
> 

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About