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

Method errors

packages/contract/src/builder.ts:96–103  ·  view source on GitHub ↗

* Adds type-safe custom errors to the contract. * The provided errors are spared-merged with any existing errors in the contract. * * @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

94 * @see {@link https://orpc.dev/docs/error-handling#type%E2%80%90safe-error-handling Type-Safe Error Handling Docs}
95 */
96 errors<U extends ErrorMap>(
97 errors: U,
98 ): ContractBuilder<TInputSchema, TOutputSchema, MergedErrorMap<TErrorMap, U>, TMeta> {
99 return new ContractBuilder({
100 ...this['~orpc'],
101 errorMap: mergeErrorMap(this['~orpc'].errorMap, errors),
102 })
103 }
104
105 /**
106 * Sets or updates the metadata for the contract.

Callers

nothing calls this directly

Calls 1

mergeErrorMapFunction · 0.90

Tested by

no test coverage detected