Added basic docs for the API
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace GeoIP2\Exception;
|
||||
|
||||
/**
|
||||
* This class represents a generic error.
|
||||
*/
|
||||
class GenericException extends \Exception
|
||||
{
|
||||
}
|
||||
|
||||
@@ -2,17 +2,24 @@
|
||||
|
||||
namespace GeoIP2\Exception;
|
||||
|
||||
class HttpException extends \Exception
|
||||
/**
|
||||
* This class represents an HTTP transport error.
|
||||
*/
|
||||
|
||||
class HttpException extends GenericException
|
||||
{
|
||||
public $code;
|
||||
/**
|
||||
* The URI queried
|
||||
*/
|
||||
public $uri;
|
||||
|
||||
public function __construct(
|
||||
$message,
|
||||
$code,
|
||||
$httpStatus,
|
||||
$uri,
|
||||
Exception $previous = null
|
||||
) {
|
||||
$this->code = $code;
|
||||
parent::__construct($message, null, $previous);
|
||||
$this->uri = $uri;
|
||||
parent::__construct($message, $httpStatus, $previous);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,18 +2,25 @@
|
||||
|
||||
namespace GeoIP2\Exception;
|
||||
|
||||
/**
|
||||
* This class represents an error returned by MaxMind's GeoIP2 Precision
|
||||
* web service.
|
||||
*/
|
||||
class WebserviceException extends HttpException
|
||||
{
|
||||
public $httpStatus;
|
||||
/**
|
||||
* The code returned by the MaxMind web service
|
||||
*/
|
||||
public $error;
|
||||
|
||||
public function __construct(
|
||||
$message,
|
||||
$code,
|
||||
$error,
|
||||
$httpStatus,
|
||||
$uri,
|
||||
Exception $previous = null
|
||||
) {
|
||||
$this->httpStatus = $httpStatus;
|
||||
parent::__construct($message, $code, $uri, $previous);
|
||||
$this->error = $error;
|
||||
parent::__construct($message, $httpStatus, $uri, $previous);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user