[ Index ]

PHP Cross Reference of YOURLS

title

Body

[close]

/includes/vendor/maxmind/web-service-common/src/Exception/ -> InvalidRequestException.php (source)

   1  <?php
   2  
   3  declare(strict_types=1);
   4  
   5  namespace MaxMind\Exception;
   6  
   7  /**
   8   * Thrown when a MaxMind web service returns an error relating to the request.
   9   */
  10  class InvalidRequestException extends HttpException
  11  {
  12      /**
  13       * The code returned by the MaxMind web service.
  14       */
  15      private readonly string $error;
  16  
  17      /**
  18       * @param string     $message    the exception message
  19       * @param string     $error      the error code returned by the MaxMind web service
  20       * @param int        $httpStatus the HTTP status code of the response
  21       * @param string     $uri        the URI queries
  22       * @param \Throwable $previous   the previous exception, if any
  23       */
  24      public function __construct(
  25          string $message,
  26          string $error,
  27          int $httpStatus,
  28          string $uri,
  29          ?\Throwable $previous = null
  30      ) {
  31          $this->error = $error;
  32          parent::__construct($message, $httpStatus, $uri, $previous);
  33      }
  34  
  35      public function getErrorCode(): string
  36      {
  37          return $this->error;
  38      }
  39  }


Generated: Sun Jul 12 05:10:03 2026 Cross-referenced by PHPXref 0.7.1