Added basic docs for the API

This commit is contained in:
Gregory Oschwald
2013-05-10 10:47:11 -07:00
parent 8922b3a164
commit 694195fedf
19 changed files with 509 additions and 14 deletions
@@ -2,6 +2,9 @@
namespace GeoIP2\Exception;
/**
* This class represents a generic error.
*/
class GenericException extends \Exception
{
}
+12 -5
View File
@@ -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);
}
}
+11 -4
View File
@@ -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);
}
}