CHAN.RUN

ensure

InferFaultErrors

Extract the error union from a declared function's error classes. Maps [typeof NotFoundError, typeof DbError] → NotFoundError | DbError.

InferFaultErrors<TErrors>

ts
type InferFaultErrors<TErrors> = InstanceType<TErrors[number]>;

Extract the error union from a declared function's error classes. Maps [typeof NotFoundError, typeof DbError] → NotFoundError | DbError.

Type Parameters

Type Parameter
TErrors extends NamedFaultErrorClass<string>[]