Ouch
(
R/RI/RIZEN/Ouch-0.0501.tar.gz, RIZEN, 2019;
MetaCPAN
)
h. Also, I tend to work on a lot of protocol-based systems that use error codes (HTTP, FTP, SMTP, JSON-RPC) rather than error classes, so that feels more natural to me. Consider the difference between
, all you need to do is:
ouch $code, $message, $data;
ouch -32700, 'Parse error.', $request; # JSON-RPC 2.0 error
ouch 441, 'You need to specify an email address.', 'email'; # form processing erro
pe. Try to stick to codes used in whatever domain you happen to be working in. HTTP Status codes. JSON-RPC error codes, etc.
=item message
A human readable error message.
=item data
Optional. Anyt