every-plugin
Version:
45 lines (44 loc) • 2.5 kB
text/typescript
import { z } from "zod";
import { ORPCError } from "@orpc/contract";
import { Cause } from "effect";
import * as _$effect_Types0 from "effect/Types";
//#region src/runtime/errors.d.ts
declare const PluginRuntimeError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => Cause.YieldableError & {
readonly _tag: "PluginRuntimeError";
} & Readonly<A>;
declare class PluginRuntimeError extends PluginRuntimeError_base<{
readonly pluginId?: string;
readonly operation?: string;
readonly procedureName?: string;
readonly cause?: Error;
readonly retryable: boolean;
}> {}
declare const ModuleFederationError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => Cause.YieldableError & {
readonly _tag: "ModuleFederationError";
} & Readonly<A>;
declare class ModuleFederationError extends ModuleFederationError_base<{
readonly pluginId: string;
readonly remoteUrl: string;
readonly cause?: Error;
}> {}
declare const ValidationError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => Cause.YieldableError & {
readonly _tag: "ValidationError";
} & Readonly<A>;
declare class ValidationError extends ValidationError_base<{
readonly pluginId: string;
readonly stage: "config" | "input" | "output" | "state";
readonly zodError: z.ZodError;
}> {}
declare const formatORPCError: (error: any) => void;
declare const isRetryableORPCCode: (code: string) => boolean;
declare const wrapORPCError: (orpcError: ORPCError<string, unknown>, pluginId?: string, procedureName?: string, operation?: string) => PluginRuntimeError;
/**
* Extracts the underlying error from Effect's FiberFailure wrapper.
* When Effect.runPromise rejects, errors are wrapped in FiberFailure.
* This extracts the original error so oRPC can handle it properly.
*/
declare const extractFromFiberFailure: (error: unknown) => unknown;
declare const toPluginRuntimeError: (error: unknown, pluginId?: string, procedureName?: string, operation?: string, defaultRetryable?: boolean) => PluginRuntimeError;
//#endregion
export { ModuleFederationError, PluginRuntimeError, ValidationError, extractFromFiberFailure, formatORPCError, isRetryableORPCCode, toPluginRuntimeError, wrapORPCError };
//# sourceMappingURL=errors.d.mts.map