Skip to content

HttpError

1 min read

Import: import system.net;

Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.

HttpError

A transport, validation, cancellation, deadline, or capability failure; HTTP statuses are not errors.

public class HttpError: Error

constructor

Creates a failure with a stable machine code and a human-readable description.

public constructor(code: string, message: string)

code

Stable category such as EINVAL, ETIMEOUT, ECANCELLED, ECLOSED, or ENOTSUP.

public fun code(): string

message

Human-readable failure detail; transport adapters omit request URLs from error messages.

public fun message(): string