-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stack trace logging for internal server errors (500) (#2204)
* feat: add stack trace logging for 500 internal server errors * remove unnecessarily comment * feat: Implement stack trace capture for 500 errors
- Loading branch information
1 parent
4960625
commit e5fcf13
Showing
2 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package routes | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/go-chi/chi" | ||
) | ||
|
||
func TestRoutes() chi.Router { | ||
r := chi.NewRouter() | ||
|
||
r.Get("/internal-server-error", func(w http.ResponseWriter, r *http.Request) { | ||
panic("Forced internal server error") | ||
}) | ||
|
||
return r | ||
} |