Skip to content

Error

A transport or protocol failure.

A response that arrives but carries a non-2xx status is reported as Status instead, which extends this type -- so catch Error catches both.

Example

try
  get "http://127.0.0.1:1"
catch Error: err
  echo $Str(err)

Inherits from: std.RuntimeError

Fields

url @ (url.Url | nil)

The URL the failure is attributed to, or nil when the underlying error carries none.

Example
try
  get "http://example.invalid"
catch Error: err
  if (err.url != nil)
    echo $err.url.host