Error.ts overview
Since v1.0.0
Exports Grouped by Category
error
BadArgument
Signature
declare const BadArgument: (props: Omit<BadArgument, PlatformError.ProvidedFields>) => BadArgument
Since v1.0.0
BadArgument (interface)
Signature
export interface BadArgument extends PlatformError.Base {
readonly _tag: "BadArgument"
}
Since v1.0.0
PlatformError (type alias)
Signature
type PlatformError = BadArgument | SystemError
Since v1.0.0
SystemError
Signature
declare const SystemError: (props: Omit<SystemError, PlatformError.ProvidedFields>) => SystemError
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>
Since v1.0.0
model
SystemErrorReason (type alias)
Signature
type SystemErrorReason =
| "AlreadyExists"
| "BadResource"
| "Busy"
| "InvalidData"
| "NotFound"
| "PermissionDenied"
| "TimedOut"
| "UnexpectedEof"
| "Unknown"
| "WouldBlock"
| "WriteZero"
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
}
Since v1.0.0
refinements
isPlatformError
Signature
declare const isPlatformError: (u: unknown) => u is PlatformError
Since v1.0.0
type id
PlatformErrorTypeId
Signature
declare const PlatformErrorTypeId: unique symbol
Since v1.0.0
PlatformErrorTypeId (type alias)
Signature
type PlatformErrorTypeId = typeof PlatformErrorTypeId
Since v1.0.0
utils
PlatformError (namespace)
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
}
Since v1.0.0
ProvidedFields (type alias)
Signature
type ProvidedFields = PlatformErrorTypeId | "_tag"
Since v1.0.0