RouteException
extends Exception
in package
RouteException class.
Table of Contents
- $additional_data : array<string|int, mixed>
- Additional error data.
- $error_code : string
- Sanitized error code.
- __construct() : mixed
- Setup exception.
- getAdditionalData() : array<string|int, mixed>
- Returns additional error data.
- getErrorCode() : string
- Returns the error code.
Properties
$additional_data
Additional error data.
public
array<string|int, mixed>
$additional_data
= []
$error_code
Sanitized error code.
public
string
$error_code
Methods
__construct()
Setup exception.
public
__construct(string $error_code, string $message[, int $http_status_code = 400 ][, array<string|int, mixed> $additional_data = [] ]) : mixed
Parameters
- $error_code : string
-
Machine-readable error code, e.g
woocommerce_invalid_product_id
. - $message : string
-
User-friendly translated error message, e.g. 'Product ID is invalid'.
- $http_status_code : int = 400
-
Proper HTTP status code to respond with, e.g. 400.
- $additional_data : array<string|int, mixed> = []
-
Extra data (key value pairs) to expose in the error response.
Return values
mixed —getAdditionalData()
Returns additional error data.
public
getAdditionalData() : array<string|int, mixed>
Return values
array<string|int, mixed> —getErrorCode()
Returns the error code.
public
getErrorCode() : string