Beispiel #1
0
 /**
  * Default method that will throw exceptions if an unsuccessful response is received.
  *
  * @param Event $event Received
  * @throws BadResponseException if the response is not successful
  */
 public static function onRequestError(Event $event)
 {
     $e = BadResponseException::factory($event['request'], $event['response']);
     $event['request']->setState(self::STATE_ERROR, array('exception' => $e) + $event->toArray());
     throw $e;
 }