Catching errors in a Perl REST API -
i coding rest api using perl/mojolicious when want throw error, example "invalid token" store error on variable called "object->lasterror" , render json response error message/code.
however gets tedious way after while. wondering if there better way considering dying , catching die error with$sig{__die__}
any suggestions? also, not using logger yet log errors
on question of logging, see: http://search.cpan.org/~garu/mojox-log-log4perl-0.10/lib/mojox/log/log4perl.pm log4perl pretty best practice in wider perl world.
without knowing lot of deep detail application, far prefer 'tedious' method [hopefully] provide information on receiving side of api, rather crash , burn $sig{__die__}
.
hope helps, bit, anyway!
Comments
Post a Comment