From b895bfe6d65a434d3faf60b69e91557367dc6d7c Mon Sep 17 00:00:00 2001 From: John Sloat Date: Sun, 24 Sep 2023 20:09:07 -0700 Subject: [PATCH] Getting bookmarked path now returns null Rather than throw error, as before. If the bookmarked path doesn't exist, allow the consumer to recover however they choose without having to use a try block --- src/common.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/common.ts b/src/common.ts index c2c4dd3..bfb4f6f 100644 --- a/src/common.ts +++ b/src/common.ts @@ -113,11 +113,8 @@ export const fade = (color: Color, change = 0.4) => export const getBookmarkedPath = (bookmarkName: string) => { const f = FileManager.iCloud(); - if (!f.bookmarkExists(bookmarkName)) - throw new Error( - `File bookmark "${bookmarkName}" doesn't exist on this device.` - ); - return f.bookmarkedPath(bookmarkName); + // File bookmark doesn't exist on this device. + return f.bookmarkExists(bookmarkName) ? f.bookmarkedPath(bookmarkName) : null; }; export class ErrorWithPayload extends Error {