ForbiddenException
extends HttpException
in package
403: the account may not do this - moderate a chat it does not own, read a private resource. Subclasses name the 403s that mean something narrower.
Tags
Table of Contents
Methods
- __construct() : mixed
- fromError() : self
- The exception an error body stands for, with or without the response it came in. A streamed call reports an error that arrives after its headers as one element of the stream, which has no status line of its own.
- fromResponse() : self
- The exception an error response stands for.
- getDomain() : ?string
- Google's error domain, e.g. `youtube.quota`, when it gave one.
- getEndpoint() : string
- The API method called, e.g. `liveChatMessages.list`.
- getErrors() : array<int, array<string, mixed>>
- getReason() : ?string
- Google's reason code, e.g. `quotaExceeded`, when it gave one.
- getResponse() : ?ResponseInterface
- getRetryAfter() : ?float
- Seconds to wait before trying again, when the response said.
- getStatus() : int
- The HTTP status, or 0 when there was no response.
Methods
__construct()
public
__construct(string $message[, int $code = 0 ][, string|null $reason = null ][, string|null $domain = null ][, array<int, array<string, mixed>> $errors = [] ][, ?ResponseInterface $response = null ][, string $endpoint = '' ][, ?Throwable $previous = null ]) : mixed
Parameters
- $message : string
- $code : int = 0
-
The HTTP status, or 0 when there was no response.
- $reason : string|null = null
-
Google's reason code, e.g.
quotaExceeded. - $domain : string|null = null
-
Google's error domain, e.g.
youtube.quota. - $errors : array<int, array<string, mixed>> = []
-
Every entry of the error's
errorslist. - $response : ?ResponseInterface = null
- $endpoint : string = ''
-
The API method called, e.g.
liveChatMessages.list. - $previous : ?Throwable = null
fromError()
The exception an error body stands for, with or without the response it came in. A streamed call reports an error that arrives after its headers as one element of the stream, which has no status line of its own.
public
static fromError(array<string, mixed> $decoded, int $status, string $endpoint[, ?ResponseInterface $response = null ]) : self
Parameters
- $decoded : array<string, mixed>
-
The decoded body:
{"error": {...}}. - $status : int
-
The HTTP status; the error's own
codeis used when it has one. - $endpoint : string
- $response : ?ResponseInterface = null
Return values
selffromResponse()
The exception an error response stands for.
public
static fromResponse(ResponseInterface $response, array<string, mixed>|null $decoded, string $endpoint) : self
Parameters
- $response : ResponseInterface
- $decoded : array<string, mixed>|null
-
The decoded body, if it was JSON.
- $endpoint : string
Return values
selfgetDomain()
Google's error domain, e.g. `youtube.quota`, when it gave one.
public
getDomain() : ?string
Return values
?stringgetEndpoint()
The API method called, e.g. `liveChatMessages.list`.
public
getEndpoint() : string
Return values
stringgetErrors()
public
getErrors() : array<int, array<string, mixed>>
Return values
array<int, array<string, mixed>> —Every entry of the error's errors list.
getReason()
Google's reason code, e.g. `quotaExceeded`, when it gave one.
public
getReason() : ?string
Return values
?stringgetResponse()
public
getResponse() : ?ResponseInterface
Return values
?ResponseInterfacegetRetryAfter()
Seconds to wait before trying again, when the response said.
public
getRetryAfter() : ?float
Return values
?floatgetStatus()
The HTTP status, or 0 when there was no response.
public
getStatus() : int