better error handling for ErrorResponseException
Fix Error handling for Put