Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
As already mentioned the proper way to communiate such problems is via an exception (i.e. calling "die").
However usually the client not only needs to know that something has gone wrong, but also what has gone wrong in order to handle the error-situation. If you communicate that with a simple string (e.g. die "error1\n") then your client has to parse the caught exception (which is then just a string) and that is brittle and silly. A much better approach would be using exception-objects from one of the frameworks that do all the heavy lifting for you. I have made good experiences with Exception::Class. In reply to Re: How do I report an error back to the user of my object?
by morgon
|
|