← all modules

Sky.Core.Error

Sky.Core.Error
  Sky.Core.Error — the single unified error type used across the

Types
  type alias ErrorInfo = { message : String , details : Maybe ErrorDetails }
  type alias PanicInfo = { message : String , stack : List String }
  type alias TypeInfo = { expected : String , actual : String }
  type Error = Error ErrorKind ErrorInfo
  type ErrorKind = Io | Network | Ffi | Decode | Timeout | NotFound | PermissionDenied | InvalidInput | Conflict | Unavailable | Unexpected
  type ErrorDetails = FfiPanic PanicInfo | TypeMismatch TypeInfo | HttpStatus Int | JsonDecode String | Custom String

Values
  conflict : String -> Error
  decode : String -> Error
  ffi : String -> Error
  invalidInput : String -> Error
  io : String -> Error
  isRetryable : Error -> Bool
      True for transient error kinds — callers can retry.
  kindLabel : ErrorKind -> String
  mkInfo : String -> ErrorInfo
  network : String -> Error
  notFound : Error
  permissionDenied : Error
  timeout : Error
  toString : Error -> String
      Human-readable `<Kind>: <message>` form. Suitable for logs, toasts,
  unavailable : String -> Error
  unexpected : String -> Error
  withDetails : ErrorDetails -> Error -> Error
  withMessage : String -> Error -> Error