MCPcopy Create free account
hub / github.com/middleapi/orpc / isDefinedError

Function isDefinedError

packages/client/src/error.ts:194–196  ·  view source on GitHub ↗
(error: T)

Source from the content-addressed store, hash-verified

192export type ORPCErrorJSON<TCode extends string, TData> = Pick<ORPCError<TCode, TData>, 'defined' | 'code' | 'status' | 'message' | 'data'>
193
194export function isDefinedError<T>(error: T): error is Extract<T, ORPCError<any, any>> {
195 return error instanceof ORPCError && error.defined
196}
197
198export function toORPCError(error: unknown): ORPCError<any, any> {
199 return error instanceof ORPCError

Callers 15

error.test.tsFile · 0.90
utils.test-d.tsFile · 0.90
safeFunction · 0.90
error.test-d.tsFile · 0.90
retryFunction · 0.90
e2e.test-d.tsFile · 0.90
onErrorFunction · 0.90
retryFunction · 0.90
e2e.test-d.tsFile · 0.90
onErrorFunction · 0.90
e2e.test-d.tsFile · 0.90
retryFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected