(options: {
readonly module: string
readonly method: string
readonly description?: string | undefined
readonly cause?: unknown
}): PlatformErrorCreates a PlatformError whose reason is a BadArgument.
When to use
Use to report a platform API rejecting caller input before performing the underlying operation.
export const const badArgument: (options: {
readonly module: string
readonly method: string
readonly description?: string | undefined
readonly cause?: unknown
}) => PlatformError
Creates a PlatformError whose reason is a BadArgument.
When to use
Use to report a platform API rejecting caller input before performing the
underlying operation.
badArgument = (options: {
readonly module: string
readonly method: string
readonly description?: string | undefined
readonly cause?: unknown
}
options: {
readonly module: stringmodule: string
readonly method: stringmethod: string
readonly description?: string | undefineddescription?: string | undefined
readonly cause?: unknowncause?: unknown
}): class PlatformErrorclass PlatformError {
message: string;
name: string;
stack: string;
cause: unknown;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
_tag: Tag;
reason: BadArgument | SystemError;
}
Tagged error used by platform APIs to report either invalid arguments or
system-level failures.
When to use
Use as the shared error type for platform APIs that expose invalid arguments
and host or operating-system failures through a single Effect error
channel.
Details
The reason field contains the underlying BadArgument or SystemError.
When that reason has a cause, the cause is preserved on the wrapper.
PlatformError => new constructor PlatformError(reason: BadArgument | SystemError): PlatformErrorTagged error used by platform APIs to report either invalid arguments or
system-level failures.
When to use
Use as the shared error type for platform APIs that expose invalid arguments
and host or operating-system failures through a single Effect error
channel.
Details
The reason field contains the underlying BadArgument or SystemError.
When that reason has a cause, the cause is preserved on the wrapper.
PlatformError(new constructor BadArgument(): BadArgumentError data for an invalid argument passed to a platform API.
When to use
Use when you need to model caller input rejected before a platform operation
runs, including invalid-argument reason data.
Details
The error records the module and method that rejected the argument, with an
optional description and cause. It is usually wrapped in PlatformError.
BadArgument(options: {
readonly module: string
readonly method: string
readonly description?: string | undefined
readonly cause?: unknown
}
options))