Default method that will throw exceptions if an unsuccessful response is received.
Event $event Received:
BadResponseException if the response is not successful
public static function onRequestError(Event $event) {
$e = BadResponseException::factory($event['request'], $event['response']);
$event['request']
->dispatch('request.exception', array(
'request' => $event['request'],
'response' => $event['response'],
'exception' => $e,
));
throw $e;
}