Skip to content

Commit 5c5f117

Browse files
Update apps/supervisor/src/workerToken.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 1f19a8c commit 5c5f117

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

apps/supervisor/src/workerToken.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ export function getWorkerToken() {
1515
})
1616
);
1717

18-
const token = readFileSync(tokenPath, "utf8");
19-
20-
return token;
18+
try {
19+
const token = readFileSync(tokenPath, "utf8").trim();
20+
return token;
21+
} catch (error) {
22+
console.error(`Failed to read worker token from file: ${tokenPath}`, error);
23+
throw new Error(`Unable to read worker token from file: ${error.message}`);
24+
}
2125
}

0 commit comments

Comments
 (0)