RateLimitExceededException
extends ApiException
in package
Thrown when a client's request rate has exceeded the API's or the local self-tracked limit. Extends ApiException (rather than plain \Exception) so that callers who already `catch (ApiException $exc)` around API calls catch this too, without needing a separate catch block. Defaults to code 429 (HTTP "Too Many Requests") unless the caller passes a different code.
Table of Contents
Properties
- $responseBody : null|stdClass|string
- The HTTP body of the server response either as Json or string.
- $responseHeaders : null|array<string|int, array<string|int, string>>
- The HTTP header of the server response.
- $responseObject : Response|ModelInterface
- The deserialized response object.
Methods
- __construct() : mixed
- Constructor.
- getResponseBody() : null|stdClass|string
- Gets the HTTP body of the server response either as Json or string.
- getResponseHeaders() : null|array<string|int, array<string|int, string>>
- Gets the HTTP response header.
- getResponseObject() : mixed
- Gets the deserialized response object (during deserialization).
- setResponseObject() : void
- Sets the deserialized response object (during deserialization).
Properties
$responseBody
The HTTP body of the server response either as Json or string.
protected
null|stdClass|string
$responseBody
$responseHeaders
The HTTP header of the server response.
protected
null|array<string|int, array<string|int, string>>
$responseHeaders
$responseObject
The deserialized response object.
protected
Response|ModelInterface
$responseObject
Methods
__construct()
Constructor.
public
__construct([mixed $message = '' ][, mixed $code = 429 ][, mixed $responseHeaders = [] ][, mixed $responseBody = null ]) : mixed
Parameters
- $message : mixed = ''
-
Error message
- $code : mixed = 429
-
HTTP status code
- $responseHeaders : mixed = []
-
HTTP response header
- $responseBody : mixed = null
-
HTTP decoded body of the server response either as \stdClass or string
getResponseBody()
Gets the HTTP body of the server response either as Json or string.
public
getResponseBody() : null|stdClass|string
Return values
null|stdClass|string —HTTP body of the server response either as \stdClass or string
getResponseHeaders()
Gets the HTTP response header.
public
getResponseHeaders() : null|array<string|int, array<string|int, string>>
Return values
null|array<string|int, array<string|int, string>> —HTTP response header
getResponseObject()
Gets the deserialized response object (during deserialization).
public
getResponseObject() : mixed
Return values
mixed —the deserialized response object
setResponseObject()
Sets the deserialized response object (during deserialization).
public
setResponseObject(mixed $obj) : void
Parameters
- $obj : mixed
-
Deserialized response object