Type guard to check if an error is a HookError.
const [, err] = await attempt(() => engine.run('validate', data)); if (isHookError(err)) { console.log(`Hook "${err.hookName}" failed`); } Copy
const [, err] = await attempt(() => engine.run('validate', data)); if (isHookError(err)) { console.log(`Hook "${err.hookName}" failed`); }
Type guard to check if an error is a HookError.