Skip to content

Commit 1ce6276

Browse files
committed
when using local status file check for previous calcs don't exit with FAILURE case on file read error, simply ignore it and move on to calculating - the file will be created during that run
1 parent e9e12d2 commit 1ce6276

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/commands/utils/compileWinners.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,12 +409,12 @@ export const readLocalFileStatusJson = (
409409

410410
const path = drawPath(chainId, prizePoolAddress, drawId);
411411
const statusPath = `${localFileStatusPath}/${path}status.json`;
412-
const fileJson = readFileSync(statusPath, "utf8");
413412

414-
if (!fileJson) {
415-
console.warn("no status.json file?");
416-
} else {
413+
try {
414+
const fileJson = readFileSync(statusPath, "utf8");
417415
status = JSON.parse(fileJson);
416+
} catch (e) {
417+
console.warn(`Error reading file at ${statusPath}, likely does not exist yet`);
418418
}
419419

420420
return status;

0 commit comments

Comments
 (0)