Print stack trace on error (#26)

This commit is contained in:
video-prize-ranch 2022-05-30 21:33:44 -04:00
parent 730ae1fa10
commit c0f0d71d01
No known key found for this signature in database
GPG Key ID: D8EAA4C5B12A7281
1 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package main package main
import ( import (
"fmt"
"net/http" "net/http"
"codeberg.org/video-prize-ranch/rimgo/pages" "codeberg.org/video-prize-ranch/rimgo/pages"
@ -24,7 +25,12 @@ func main() {
StreamRequestBody: true, StreamRequestBody: true,
}) })
app.Use(recover.New()) app.Use(recover.New(recover.Config{
EnableStackTrace: true,
StackTraceHandler: func (c *fiber.Ctx, e interface{}) {
fmt.Println(e)
},
}))
app.Use("/static", filesystem.New(filesystem.Config{ app.Use("/static", filesystem.New(filesystem.Config{
Root: http.FS(static.GetFiles()), Root: http.FS(static.GetFiles()),
})) }))