Savon vs. Handsoap: Errors

This documentation is deprecated, please have a look at!

Both client libraries provide the same default behavior for error handling; they raise distinct exceptions for SOAP and HTTP errors:

  • Handsoap::HttpError / Handsoap::Fault
  • Savon::HTTPError / Savon::SOAPFault

And both clients offer a way to override that behavior. Savon lets you surpress errors globally and provides a simple error handling interface on the response object:

Savon::Response.raise_errors = false
p response.soap_fault
p response.http_error

The same can be achieved in Handsoap by overwriting error hooks in the service implementation:

def on_fault(fault)
  p fault

def on_http_error(response)
  p response

1 thought on “Savon vs. Handsoap: Errors

  1. Pingback: Savon Handsoap Shootout | #nofail

Comments are closed.