ApiException
extends HushHushException
in package
FinalYes
Thrown for any non-2xx response from hush-hush.
requestId is populated only when the response carries a documented
request-ID header; hush-hush's spec doesn't currently document one, so
this is usually null. Kept as a property rather than omitted so a
future spec addition doesn't change this type's shape.
Table of Contents
Properties
- $apiMessage : string|null
- The parsed `error` field from hush-hush's error body, if present.
- $body : string
- The raw, unparsed response body, for a caller that needs more than `apiMessage`.
- $requestId : string|null
- $status : int
Methods
- __construct() : mixed
- apiMessage() : string|null
- body() : string
- fromGenerated() : self
- requestId() : string|null
- status() : int
- parseMessage() : string|null
Properties
$apiMessage read-only
The parsed `error` field from hush-hush's error body, if present.
private
string|null
$apiMessage
$body read-only
The raw, unparsed response body, for a caller that needs more than `apiMessage`.
private
string
$body
$requestId read-only
private
string|null
$requestId
$status read-only
private
int
$status
Methods
__construct()
public
__construct(int $status, string $body, string|null $requestId) : mixed
Parameters
- $status : int
- $body : string
- $requestId : string|null
apiMessage()
public
apiMessage() : string|null
Return values
string|nullbody()
public
body() : string
Return values
stringfromGenerated()
public
static fromGenerated(ApiException $exception) : self
Parameters
- $exception : ApiException
Return values
selfrequestId()
public
requestId() : string|null
Return values
string|nullstatus()
public
status() : int
Return values
intparseMessage()
private
static parseMessage(string $body) : string|null
Parameters
- $body : string