Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
refactor: throw more helpful error if no data
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbruford committed Aug 8, 2020
1 parent b98ef22 commit e561d87
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/app/journal/read-json-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function readJSONFile<T>(filename: string) {
reject(err);
} else {
try {
if (!data) { throw new Error(`No data to parse from ${filename}`) }
resolve(JSON.parse(data));
} catch (e) {
reject(e);
Expand Down

0 comments on commit e561d87

Please sign in to comment.