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 34
__construct(Response $response, false|int|null $truncateExceptionsAt = null)

Create a new exception instance.

Parameters

Response $response
false|int|null $truncateExceptionsAt

at line 49
static void truncate()

Enable truncation of request exception messages.

Boot-only. The flag persists in a static property for the worker lifetime and applies to every HTTP client exception across all coroutines.

Return Value

void

at line 60
static void truncateAt(int $length)

Set the truncation length for request exception messages.

Boot-only. The length persists in a static property for the worker lifetime and applies to every HTTP client exception across all coroutines.

Parameters

int $length

Return Value

void

at line 71
static void dontTruncate()

Disable truncation of request exception messages.

Boot-only. The flag persists in a static property for the worker lifetime and applies to every HTTP client exception across all coroutines.

Return Value

void

at line 79
bool report()

Prepare the exception message and set the summarized flag.

Return Value

bool

at line 93
protected string prepareMessage(Response $response)

Prepare the exception message.

Parameters

Response $response

Return Value

string

at line 115
static void flushState()

Flush all static state.

Return Value

void