TelegramPHP Documentation

ConflictException extends HttpException
in package

Thrown on `409 Conflict` - most often a webhook is active while {@see \Telegram\Api\UpdateApi::getUpdates()} is being polled, or two pollers share one token.

Tags
author

Valithor Obsidion valithor@valgorithms.com

Table of Contents

Methods

__construct()  : mixed
fromResponse()  : self
Builds the most specific exception class for a Bot API error response.
getErrorCode()  : int
The Bot API `error_code`, which mirrors the HTTP status.
getMigrateToChatId()  : ?int
The supergroup the request should be retried against, set when a group chat has been upgraded and the old `chat_id` no longer resolves.
getParameters()  : array<string, mixed>
The `parameters` object from the error envelope.
getResponse()  : ?ResponseInterface
The raw response, when the failure came back over HTTP at all.
getRetryAfter()  : ?int
Seconds to wait before repeating the request, when Telegram said so.

Methods

__construct()

public __construct(string $message[, int $errorCode = 0 ][, ?ResponseInterface $response = null ][, array<string, mixed> $parameters = [] ][, ?Throwable $previous = null ]) : mixed
Parameters
$message : string
$errorCode : int = 0
$response : ?ResponseInterface = null
$parameters : array<string, mixed> = []

The parameters object from the error envelope.

$previous : ?Throwable = null

fromResponse()

Builds the most specific exception class for a Bot API error response.

public static fromResponse(ResponseInterface $response[, array<string, mixed>|null $decoded = null ]) : self
Parameters
$response : ResponseInterface
$decoded : array<string, mixed>|null = null

The decoded body, when it parsed as JSON.

Return values
self

getErrorCode()

The Bot API `error_code`, which mirrors the HTTP status.

public getErrorCode() : int
Return values
int

getMigrateToChatId()

The supergroup the request should be retried against, set when a group chat has been upgraded and the old `chat_id` no longer resolves.

public getMigrateToChatId() : ?int
Return values
?int

getParameters()

The `parameters` object from the error envelope.

public getParameters() : array<string, mixed>
Return values
array<string, mixed>

getResponse()

The raw response, when the failure came back over HTTP at all.

public getResponse() : ?ResponseInterface
Return values
?ResponseInterface

getRetryAfter()

Seconds to wait before repeating the request, when Telegram said so.

public getRetryAfter() : ?int
Return values
?int
On this page

Search results