mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-11-06 12:51:54 +00:00
🧹 improve observability by adding console.debug to empty catch blocks
Replaced empty catch blocks in `loadCanonicalRoster` and `parseLockEvent` with `console.debug` statements that log the error message. This improves observability of failures while maintaining the graceful fallback behavior. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
c731f2b09d
commit
983ad0627b
1 file changed
+4
-2
+4
-2
@@ -151,7 +151,8 @@ function loadCanonicalRoster() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.error(`WARNING: Roster file is missing daily/weekly entries, falling back: ${rosterPath}`);
|
console.error(`WARNING: Roster file is missing daily/weekly entries, falling back: ${rosterPath}`);
|
||||||
} catch {
|
} catch (err) {
|
||||||
|
console.debug(`Note: Could not load roster from ${rosterPath}: ${err.message}`);
|
||||||
// It's okay if roster file is missing when used as a library/CLI without the file present
|
// It's okay if roster file is missing when used as a library/CLI without the file present
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,7 +206,8 @@ export function parseLockEvent(event) {
|
|||||||
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
||||||
content = parsed;
|
content = parsed;
|
||||||
}
|
}
|
||||||
} catch {
|
} catch (err) {
|
||||||
|
console.debug(`Note: Failed to parse event content as JSON: ${err.message}`);
|
||||||
// Ignore malformed JSON content
|
// Ignore malformed JSON content
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user