Oihana PHP Arango

MaintenanceException extends ArangoException

Thrown when ArangoDB reports the cluster backend is unavailable (typically during maintenance windows or coordinator failovers).

Maps to the internal Arango code ErrorCode::CLUSTER_BACKEND_UNAVAILABLE (3002). The caller should retry after a short backoff.

Tags
see
https://docs.arangodb.com/stable/develop/error-codes-and-meanings/
author

Marc Alcaraz (ekameleon)

since
1.0.0

Table of Contents

Properties

$errorNum  : int|null

Methods

__construct()  : mixed
Creates a new MaintenanceException instance.
fromResponse()  : ArangoException
Builds the appropriate {@see ArangoException} subclass from a parsed ArangoDB error response.
isSafeToRetry()  : bool
Maintenance errors are transient: the caller should retry after a short backoff.

Properties

Methods

__construct()

Creates a new MaintenanceException instance.

public __construct([string $message = 'Cluster backend unavailable' ][, int $httpStatus = 503 ][, Throwable|null $previous = null ]) : mixed
Parameters
$message : string = 'Cluster backend unavailable'

Server-provided message.

$httpStatus : int = 503

HTTP status returned by the server (defaults to 503).

$previous : Throwable|null = null

Previous exception in the chain.

fromResponse()

Builds the appropriate {@see ArangoException} subclass from a parsed ArangoDB error response.

public static fromResponse(int $httpStatus[, array<string|int, mixed> $body = [] ][, Throwable|null $previous = null ]) : ArangoException

The factory inspects the errorNum field of the response body and dispatches to a dedicated subclass when the code is known. The HTTP status is preserved on the resulting exception (exposed via getCode()).

Expected body shape (server-provided):

{ "error": true, "code": 404, "errorNum": 1202, "errorMessage": "document not found" }
Parameters
$httpStatus : int

HTTP status returned by the server.

$body : array<string|int, mixed> = []

Decoded JSON body (may be empty when the server returned no body).

$previous : Throwable|null = null

Previous exception in the chain (typically the Guzzle exception).

Return values
ArangoException

isSafeToRetry()

Maintenance errors are transient: the caller should retry after a short backoff.

public isSafeToRetry() : bool
Return values
bool

Always true.

On this page

Search results