error handling for all requests.