RequestException

Classin exceptionsfastly-compute 0.1.3View source

Extends IOError.

Base exception for all requests-related errors.

Constructor

RequestException(message: str, response: FastlyResponse | None = None, request: http_req.Request | None = None) -> None

Initialize RequestException.

Parameters

message: str

Error message

response: FastlyResponse | Noneoptional = None

Optional response object that caused the error

request: http_req.Request | Noneoptional = None

Optional request object that caused the error

Returns

None

Properties

request

http_req.Request | NoneView source

Methods

from_detailed_error

staticView source
from_detailed_error(err: ErrorWithDetail, operation: str) -> RequestException

Create a requests exception from an ErrorWithDetail.

Parameters

err: ErrorWithDetail

The error to map from

operation: str

Description of what operation failed

Returns

RequestException

Appropriate RequestException subclass instance

from_fastly_error

staticView source
from_fastly_error(err: FastlyError, operation: str) -> RequestException

Create a requests exception from a FastlyError or subclass.

Parameters

err: FastlyError

The error to map from

operation: str

Description of what operation failed

Returns

RequestException

Appropriate RequestException subclass instance