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

Method errors

packages/server/src/builder.ts:158–165  ·  view source on GitHub ↗

* Adds type-safe custom errors. * The provided errors are spared-merged with any existing errors. * * @see https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs

(
    errors: U,
  )

Source from the content-addressed store, hash-verified

156 * @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
157 */
158 errors<U extends ErrorMap>(
159 errors: U,
160 ): Builder<TInitialContext, TCurrentContext, TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta> {
161 return new Builder({
162 ...this['~orpc'],
163 errorMap: mergeErrorMap(this['~orpc'].errorMap, errors),
164 })
165 }
166
167 /**
168 * Uses a middleware to modify the context or improve the pipeline.

Callers

nothing calls this directly

Calls 1

mergeErrorMapFunction · 0.90

Tested by

no test coverage detected