* Catch all error effects and throw them as an error. * @param message The message of the error. If it is a function, it will be called with the name * and the message of the error effect, and the return value will be used as the message of the * error. * @returns * * @since 0.1.1
(
message?: string | ((error: string, message?: string) => string | undefined),
)
| 1121 | * @since 0.1.1 |
| 1122 | */ |
| 1123 | catchAllAndThrow( |
| 1124 | message?: string | ((error: string, message?: string) => string | undefined), |
| 1125 | ): Effected<ExcludeEffect<E, Effect.Error>, R> { |
| 1126 | return this.catchAll((error, ...args) => { |
| 1127 | throw new (buildErrorClass(error))( |
| 1128 | ...(typeof message === "string" ? [message] |
| 1129 | : typeof message === "function" ? [message(error, ...args)].filter((v) => v !== undefined) |
| 1130 | : args), |
| 1131 | ); |
| 1132 | }); |
| 1133 | } |
| 1134 | |
| 1135 | /** |
| 1136 | * Provide a value for a dependency effect. |
nothing calls this directly
no test coverage detected