in reply to Exceptions vs Context Objects

I'd use die (or croak) with eval-Block as well

It might be a good idea to standardize the error messages, e.g die "Error: $errorCode\t$message\n"; and write all the possible codes/messages at least into the documentation (or create a function/module which returns the error messages, e.g. like DBI::err(str)

Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"

Replies are listed 'Best First'.
Re^2: Exceptions vs Context Objects
by eric256 (Parson) on Mar 31, 2006 at 15:06 UTC

    I played with die, but didn't realy like messing with error codes as thats seemed a good source of typos. So i was thinking about using Error.pm instead. After sleeping on it, i think i want both Exceptions and a Context object to hand around. That way plugins can do thow Plugin::AbortEvent("Failed to load file") and use the context object/hash to pass around input and output variables.


    ___________
    Eric Hodges