diff options
Diffstat (limited to 'packages/trpc/lib/ruleEngine.ts')
| -rw-r--r-- | packages/trpc/lib/ruleEngine.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/trpc/lib/ruleEngine.ts b/packages/trpc/lib/ruleEngine.ts index 233a6acf..acfd747e 100644 --- a/packages/trpc/lib/ruleEngine.ts +++ b/packages/trpc/lib/ruleEngine.ts @@ -72,13 +72,16 @@ export class RuleEngine { ); } - static async forBookmark(ctx: AuthedContext, bookmarkId: string) { + static async forBookmark( + ctx: AuthedContext, + bookmarkId: string, + ): Promise<RuleEngine | null> { const [bookmark, rules] = await Promise.all([ fetchBookmark(ctx.db, bookmarkId), RuleEngineRuleModel.getAll(ctx), ]); if (!bookmark) { - throw new Error(`Bookmark ${bookmarkId} not found`); + return null; } return new RuleEngine( ctx, |
