Working with Web Services > Handling faults > Fault Checking with REST in Perl

Fault Checking with REST in Perl

For REST, it is a good idea to account for failures in the responses.

For example, in the SearchSamples Perl code, line 191 checks for this condition:

die $response->message . "\n" . $response->content unless $response->is_success;

This line stops the execution of the program if the response does not return with is_success. If there is a failure, the message title and the error message display for the user.

Related topics 

 


© 2009-2012 SirsiDynix