AdguardTeam / AdguardTeam/AdGuardHome

Improve HTTP responses when the server is panicking

Offen
#3,740 0 Kommentare 1 Reaktion 1 zugewiesene Person Beansprucht von @EugeneOne1 Auf GitHub ansehen
enhancement P3: Medium
Vorherrschende Sprache
TypeScript
Sterne
36.9k
Forks
2.5k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Currently, there are cases where AdGuard Home's internals encounter a runtime panic, which results in the frontend receiving no responses. AGH doesn't crash itself, since the default HTTP server has its own panic handling, but that's still rather poor UX.

What we need is a simple HTTP middleware that:

1. Recovers the panic.

2. Writes a `500` response with an appropriate content type (typically, a JSON object) that contains the panic's message.

3. Writes a backtrace, preferably on the `error` level as opposed to the current `debug`.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.