-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
0 / 10 of 1 issue completedDescription
Consider to simplify all the utilities to be better used in Promise and async situations.
e.g.
export function expect<T extends object, R = void>(type: Constructor<T>, handler: (error: T) => R): (error: unknown) => R | never
{
return (error: unknown): R | never =>
{
if (error instanceof type) { return handler(error); }
throw error;
};
}
new Promise([...])
.catch(expect(ValueError, (error: ValueError) => { ... });Sub-issues
Metadata
Metadata
Assignees
Labels
No labels