class RequestException extends HttpClientException (View source)

Properties

Response $response

The response instance.

int|false|null $truncateExceptionsAt

The current truncation length for the exception message.

static int|false $truncateAt

The global truncation length for the exception message.

bool $hasBeenSummarized

Whether the response has been summarized in the message.

Methods

__construct(Response $response, int|false|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.

string
prepareMessage(Response $response)

Prepare the exception message.

Details

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

Create a new exception instance.

Parameters

Response $response
int|false|null $truncateExceptionsAt

static void truncate()

Enable truncation of request exception messages.

Return Value

void

static void truncateAt(int $length)

Set the truncation length for request exception messages.

Parameters

int $length

Return Value

void

static void dontTruncate()

Disable truncation of request exception messages.

Return Value

void

bool report()

Prepare the exception message.

Return Value

bool

protected string prepareMessage(Response $response)

Prepare the exception message.

Parameters

Response $response

Return Value

string