Module: core.error

Source: ./core/error.reef


Overview

core.error - Shared structured Error type

Provides a common, structured error representation used across the stdlib (e.g. as Result's error payload). An Error carries a coarse ErrorKind classification, a human-readable message, and an optional numeric code (0 by default).


Types

ErrorKind (enum)

Coarse classification of error causes, shared across stdlib packages.

Variants:

  • NotFound
  • InvalidInput
  • PermissionDenied
  • IoError
  • AlreadyExists
  • Unsupported
  • WouldBlock
  • Timeout
  • OutOfRange
  • Other

Error

A structured error: a classification, a human-readable message, and an optional numeric code (0 when unused).

Fields:

Name Type
kind ErrorKind
message string
code int

Functions

fn error(kind: ErrorKind, message: string): Error

Constructs an Error with code 0.

fn error_with_code(kind: ErrorKind, message: string, code: int): Error

Constructs an Error with an explicit numeric code.

fn error_kind(e: Error): ErrorKind

Returns the error's kind.

fn error_message(e: Error): string

Returns the error's message.

fn error_code(e: Error): int

Returns the error's numeric code.


Generated by reefc doc