Handle errors from the request to couch