コード例 #1
0
ファイル: HttpException.php プロジェクト: 99designs/sipht
 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);
     }
 }