MindeeHttpException
extends MindeeException
in package
Exceptions relating to HTTP calls.
Handles uncaught error codes.
Table of Contents
Properties
- $apiCode : string|mixed|null
- $apiDetails : mixed|null
- $apiMessage : string|mixed|null
- $statusCode : int
Methods
- __construct() : mixed
- createErrorObj() : array<string|int, string>
- Builds an appropriate error object from the server reply.
- handleError() : MindeeHttpException
Properties
$apiCode
public
string|mixed|null
$apiCode
API code as sent by the server.
$apiDetails
public
mixed|null
$apiDetails
API details field as sent by the server.
$apiMessage
public
string|mixed|null
$apiMessage
API message field as sent by the server.
$statusCode
public
int
$statusCode
Status code as sent by the server.
Methods
__construct()
public
__construct(array<string|int, mixed> $httpError, string $url, int $code) : mixed
Parameters
- $httpError : array<string|int, mixed>
-
Array containing the error data.
- $url : string
-
Remote URL the error was found on.
- $code : int
-
Error code.
createErrorObj()
Builds an appropriate error object from the server reply.
public
static createErrorObj(array<string|int, mixed>|string $response) : array<string|int, string>
Parameters
- $response : array<string|int, mixed>|string
-
Parsed server response.
Tags
Return values
array<string|int, string>handleError()
public
static handleError(string $url, array<string|int, mixed>|string|bool $response) : MindeeHttpException
Parameters
- $url : string
-
Remote URL the error was found on.
- $response : array<string|int, mixed>|string|bool
-
Raw server response.