emit an error event when a request fails