Skip to content

Commit

Permalink
Handle missing cache file (#25)
Browse files Browse the repository at this point in the history
* check if cache file is actually missing

* just rethrow per kocka
  • Loading branch information
LunarTwilight authored Nov 16, 2024
1 parent a0e607d commit 6619266
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,13 @@ class ContentReviewLog {
}
})).default;
} catch (error) {
console.info(
'No cache.json file found, data will be created from scratch.'
);
if (error.code === 'ERR_MODULE_NOT_FOUND') {
console.info(
'No cache.json file found, data will be created from scratch.'
);
} else {
throw error;
}
}
}
/**
Expand Down

0 comments on commit 6619266

Please sign in to comment.