update v 1.0.7.5

This commit is contained in:
Sujit Prasad
2016-06-13 20:41:55 +05:30
parent aa9786d829
commit 283d97e3ea
5078 changed files with 339851 additions and 175995 deletions

View File

@@ -0,0 +1,10 @@
<?php
namespace MaxMind\Exception;
/**
* This class represents an error authenticating
*/
class AuthenticationException extends InvalidRequestException
{
}

View File

@@ -0,0 +1,40 @@
<?php
namespace MaxMind\Exception;
/**
* This class represents an HTTP transport error.
*/
class HttpException extends WebServiceException
{
/**
* The URI queried
*/
private $uri;
/**
* @param string $message A message describing the error.
* @param int $httpStatus The HTTP status code of the response
* @param string $uri The URI used in the request.
* @param \Exception $previous The previous exception, if any.
*/
public function __construct(
$message,
$httpStatus,
$uri,
\Exception $previous = null
) {
$this->uri = $uri;
parent::__construct($message, $httpStatus, $previous);
}
public function getUri()
{
return $this->uri;
}
public function getStatusCode()
{
return $this->getCode();
}
}

View File

@@ -0,0 +1,10 @@
<?php
namespace MaxMind\Exception;
/**
* Thrown when the account is out of credits.
*/
class InsufficientFundsException extends InvalidRequestException
{
}

View File

@@ -0,0 +1,12 @@
<?php
namespace MaxMind\Exception;
/**
* This class represents an error in creating the request to be sent to the
* web service. For example, if the array cannot be encoded as JSON or if there
* is a missing or invalid field.
*/
class InvalidInputException extends WebServiceException
{
}

View File

@@ -0,0 +1,37 @@
<?php
namespace MaxMind\Exception;
/**
* Thrown when a MaxMind web service returns an error relating to the request.
*/
class InvalidRequestException extends HttpException
{
/**
* The code returned by the MaxMind web service
*/
private $error;
/**
* @param string $message The exception message
* @param int $error The error code returned by the MaxMind web service
* @param int $httpStatus The HTTP status code of the response
* @param string $uri The URI queries
* @param \Exception $previous The previous exception, if any.
*/
public function __construct(
$message,
$error,
$httpStatus,
$uri,
\Exception $previous = null
) {
$this->error = $error;
parent::__construct($message, $httpStatus, $uri, $previous);
}
public function getErrorCode()
{
return $this->error;
}
}

View File

@@ -0,0 +1,7 @@
<?php
namespace MaxMind\Exception;
class IpAddressNotFoundException extends InvalidRequestException
{
}

View File

@@ -0,0 +1,10 @@
<?php
namespace MaxMind\Exception;
/**
* This exception is thrown when the service requires permission to access.
*/
class PermissionRequiredException extends InvalidRequestException
{
}

View File

@@ -0,0 +1,10 @@
<?php
namespace MaxMind\Exception;
/**
* This class represents a generic web service error.
*/
class WebServiceException extends \Exception
{
}