* 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,
)
| 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. |
nothing calls this directly
no test coverage detected