Skip to content

C3Http.RequestError

Inherits: RefCounted

Structured error placed on error when ok is false.

Properties

Type Name Default
Kind kind 0
String message ""
int status 0

Methods

Returns Signature
C3Http.RequestError transport(p_message: String)
C3Http.RequestError timed_out(p_message: String)
C3Http.RequestError client_error(p_message: String)
C3Http.RequestError cancelled(p_message: String)
C3Http.RequestError body_size_limit_exceeded(p_message: String)

Constants

enum Kind

Name Value Description
TRANSPORT 0 No usable HTTP response (DNS, TLS, connection, or request-start failure).
HTTP 1 A non-2xx status was received.
CLIENT 2 The request was rejected before being sent (e.g. an invalid argument).
CANCELLED 3 The caller aborted the request.
TIMEOUT 4 No response was received before the timeout elapsed.
BODY_SIZE_LIMIT_EXCEEDED 5 The response body exceeded body_size_limit.

Property Descriptions

Kind kind = 0

Broad category of failure. One of the Kind values.

String message = ""

Human-readable description. Never empty.

int status = 0

HTTP status code, or 0 when not applicable.

Method Descriptions

transport

func transport(p_message: String) -> C3Http.RequestError:

Builds an error for a transport-level failure with no usable HTTP response.

timed_out

func timed_out(p_message: String) -> C3Http.RequestError:

Builds an error for a request that received no response before the timeout.

client_error

func client_error(p_message: String) -> C3Http.RequestError:

Builds an error for a request rejected before being sent.

cancelled

func cancelled(p_message: String) -> C3Http.RequestError:

Builds an error for a caller-initiated cancellation.

body_size_limit_exceeded

func body_size_limit_exceeded(p_message: String) -> C3Http.RequestError:

Builds an error for a response body that exceeded body_size_limit.