fix: 🐛 network errors swallowed by fail open, add debug log

This commit is contained in:
amianthus
2026-04-28 14:39:53 +01:00
parent 17b50307d8
commit 5845a9a086

View File

@@ -74,10 +74,14 @@ export class FailOpenHook implements SDKInitHook, AfterErrorHook {
fetcher: async (input, init) => {
try {
return init == null ? await fetch(input) : await fetch(input, init);
} catch {
} catch (error) {
console.log(error);
console.log(
`Network failed to reach Autumn: ${error}. Returning 555 Network Error.`,
);
return new Response(null, {
status: 503,
statusText: "Autumn Unreachable",
status: 555,
statusText: "Network Error",
});
}
},