Skip to main content Link Search Menu Expand Document (external link)

Error.ts overview

Since v1.0.0


Exports Grouped by Category


error

BadArgument

Signature

declare const BadArgument: (props: Omit<BadArgument, PlatformError.ProvidedFields>) => BadArgument

Source

Since v1.0.0

BadArgument (interface)

Signature

export interface BadArgument extends PlatformError.Base {
  readonly _tag: "BadArgument"
}

Source

Since v1.0.0

PlatformError (type alias)

Signature

type PlatformError = BadArgument | SystemError

Source

Since v1.0.0

SystemError

Signature

declare const SystemError: (props: Omit<SystemError, PlatformError.ProvidedFields>) => SystemError

Source

Since v1.0.0

TypeIdError

Signature

declare const TypeIdError: <const TypeId extends symbol, const Tag extends string>(
  typeId: TypeId,
  tag: Tag
) => new <A extends Record<string, any>>(
  args: Simplify<A>
) => Cause.YieldableError & Record<TypeId, TypeId> & { readonly _tag: Tag } & Readonly<A>

Source

Since v1.0.0

model

SystemErrorReason (type alias)

Signature

type SystemErrorReason =
  | "AlreadyExists"
  | "BadResource"
  | "Busy"
  | "InvalidData"
  | "NotFound"
  | "PermissionDenied"
  | "TimedOut"
  | "UnexpectedEof"
  | "Unknown"
  | "WouldBlock"
  | "WriteZero"

Source

Since v1.0.0

models

SystemError (interface)

Signature

export interface SystemError extends PlatformError.Base {
  readonly _tag: "SystemError"
  readonly reason: SystemErrorReason
  readonly syscall?: string | undefined
  readonly pathOrDescriptor: string | number
}

Source

Since v1.0.0

refinements

isPlatformError

Signature

declare const isPlatformError: (u: unknown) => u is PlatformError

Source

Since v1.0.0

type id

PlatformErrorTypeId

Signature

declare const PlatformErrorTypeId: unique symbol

Source

Since v1.0.0

PlatformErrorTypeId (type alias)

Signature

type PlatformErrorTypeId = typeof PlatformErrorTypeId

Source

Since v1.0.0

utils

PlatformError (namespace)

Source

Since v1.0.0

Base (interface)

Signature

export interface Base {
  readonly [PlatformErrorTypeId]: typeof PlatformErrorTypeId
  readonly _tag: string
  readonly module: "Clipboard" | "Command" | "FileSystem" | "KeyValueStore" | "Path" | "Stream" | "Terminal"
  readonly method: string
  readonly message: string
}

Source

Since v1.0.0

ProvidedFields (type alias)

Signature

type ProvidedFields = PlatformErrorTypeId | "_tag"

Source

Since v1.0.0