Exemplo n.º 1
0
 public static function fromGuzzleException($ex)
 {
     if ($ex instanceof \Guzzle\Http\Exception\ServerErrorResponseException) {
         return ServerErrorException::fromServerErrorResponseException($ex);
     } elseif ($ex instanceof \Guzzle\Http\Exception\ClientErrorResponseException) {
         return BadRequestException::fromClientErrorResponseException($ex);
     } else {
         return new self($ex->getMessage(), 0, $ex);
     }
 }
Exemplo n.º 2
0
 public function __construct($message)
 {
     parent::__construct($message, 501);
 }
 /**
  * InternalServerErrorException constructor.
  *
  * @param string $message  Error message (HTTP) that defines this exception
  * @param int    $code     Error code (HTTP) that defines this exception
  * @param null   $previous Inner/Previous exception that triggered this exception
  */
 public function __construct($message = self::HTTP_MESSAGE, $code = self::HTTP_CODE, $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }