Skip Menu |

This queue is for tickets about the Net-OAuth-Simple CPAN distribution.

Report information
The Basics
Id: 46413
Status: resolved
Priority: 0/
Queue: Net-OAuth-Simple

People
Owner: Nobody in particular
Requestors: chris [...] oak-wood.co.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.1
Fixed in: (no value)



Subject: Poor error handling
The extensive use of 'die' makes the module difficult to work with. For example, using 'die' in _make_request if the response is not successful is awkward. In a program that makes repeated calls, the failure of one is not necessarilly fatal. Having to wrap each request in an eval, and then parse a long and ugly $@ is awkward. An alternative would be to return undef, and provide a further method, or method, to allow details of the problem to be obtained, eg get_error(), http_code(), http_message() etc
The old "die" behaviour is still the default (for backwards compatibility) but there's a now an instantiation time option no_die_on_error which means that methods now return undef and the error is available in last_error(). Thanks! Simon