handle

Handles an error and do something with the response if needed.