http://qs321.pair.com?node_id=493989


in reply to Style guide for error messages?

Perl Best Practices covers this issue well. Objects are the thing to throw.

I disagree with some of your ideas:

Like Best Practices I would suggest using objects, in your first pass use the object type and the long output of a bare croak, in your message clean up phase use another method to output the exceptions' error strings. Since these methods or the table they use doesn't exist the brokenness forces the fix; examining your type tree gives you a list of all your errors and their meanings then you just need express them. This implies handler objects or another way of consolidating your error handling code.

You may complain that I've only moved your problem to the naming of exception packages. I won't argue.

Be well,
rir