in reply to die or croak
If you get an exception because you misused the API of a module, you usually want to know where in your the error is, so you're happier when the module called croak().
Of course that concept breaks down when you write a module that uses another module which uses croak() -- the errors will come from your module, not from your module user's code.
In the case of internal errors, modules should use die, or maybe even Carp::confess.
(Oh, and if (as a user) you want to get a backtrace no matter what, use Carp::Always).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: die or croak
by Corion (Patriarch) on Aug 09, 2013 at 19:28 UTC | |
by McA (Priest) on Aug 09, 2013 at 19:32 UTC | |
by Corion (Patriarch) on Aug 09, 2013 at 19:44 UTC | |
by McA (Priest) on Aug 09, 2013 at 20:21 UTC | |
|
Re^2: die or croak
by McA (Priest) on Aug 09, 2013 at 19:35 UTC |