class RequestException extends HttpClientException

Constants

DEFAULT_TRUNCATE_AT

The default truncation length for exception messages.

Properties

false|int|null $truncateExceptionsAt

The current truncation length for the exception message.

static false|int $truncateAt

The global truncation length for the exception message.

bool $hasBeenSummarized

Whether the response has been summarized in the message.

Methods

__construct(Response $response, false|int|null $truncateExceptionsAt = null)

Create a new exception instance.

static void
truncate()

Enable truncation of request exception messages.

static void
truncateAt(int $length)

Set the truncation length for request exception messages.

static void
dontTruncate()

Disable truncation of request exception messages.

bool
report()

Prepare the exception message and set the summarized flag.

string
prepareMessage(Response $response)

Prepare the exception message.

static void
flushState()

Flush all static state.

Details

at line 35
__construct(Response $response, false|int|null $truncateExceptionsAt = null)

Create a new exception instance.

Parameters

Response $response
false|int|null $truncateExceptionsAt

at line 50
static void truncate()

Enable truncation of request exception messages.

The global default persists for the worker lifetime across all coroutines; per-request truncation settings take precedence.

Return Value

void

at line 62
static void truncateAt(int $length)

Set the truncation length for request exception messages.

The global default persists for the worker lifetime across all coroutines; per-request truncation settings take precedence.

Parameters

int $length

Return Value

void

at line 74
static void dontTruncate()

Disable truncation of request exception messages.

The global default persists for the worker lifetime across all coroutines; per-request truncation settings take precedence.

Return Value

void

at line 83
bool report()

Prepare the exception message and set the summarized flag.

Return Value

bool

at line 97
protected string prepareMessage(Response $response)

Prepare the exception message.

Parameters

Response $response

Return Value

string

at line 119
static void flushState()

Flush all static state.

Return Value

void