Improved WsRestClient error handling