Webservice client unit tests and fixes for bugs discovered while creating them
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace GeoIP2\Exception;
|
||||
|
||||
class GenericException extends \Exception
|
||||
{
|
||||
}
|
||||
|
||||
@@ -4,11 +4,13 @@ namespace GeoIP2\Exception;
|
||||
|
||||
class HttpException extends \Exception
|
||||
{
|
||||
public $code;
|
||||
|
||||
public function __construct($message, $code, $uri,
|
||||
Exception $previous = null)
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
$this->code = $code;
|
||||
parent::__construct($message, null, $previous);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace GeoIP2\Exception;
|
||||
|
||||
class WebserviceException extends HttpException
|
||||
{
|
||||
public $httpStatus;
|
||||
|
||||
public function __construct($message, $code, $httpStatus, $uri,
|
||||
Exception $previous = null)
|
||||
{
|
||||
$this->httpStatus = $httpStatus;
|
||||
parent::__construct($message, $code, $uri, $previous);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user