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

Error overview

Added in v1.0.0


Table of contents


error

BadArgument

Signature

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

Added in v1.0.0

BadArgument (interface)

Signature

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

Added in v1.0.0

PlatformError (type alias)

Signature

export type PlatformError = BadArgument | SystemError

Added in v1.0.0

SystemError

Signature

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

Added in v1.0.0

TypeIdError

Signature

export 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>

Added in v1.0.0

model

SystemErrorReason (type alias)

Signature

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

Added in 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
}

Added in v1.0.0

refinements

isPlatformError

Signature

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

Added in v1.0.0

type id

PlatformErrorTypeId

Signature

export declare const PlatformErrorTypeId: typeof PlatformErrorTypeId

Added in v1.0.0

PlatformErrorTypeId (type alias)

Signature

export type PlatformErrorTypeId = typeof PlatformErrorTypeId

Added in v1.0.0

utils

PlatformError (namespace)

Added in 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
}

Added in v1.0.0

ProvidedFields (type alias)

Signature

export type ProvidedFields = PlatformErrorTypeId | "_tag"

Added in v1.0.0