Save the path in a crash

This commit is contained in:
Eduard Urbach 2019-11-04 17:08:47 +09:00
parent 60c0baa9ab
commit 2a2c7bbc2f
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
3 changed files with 3 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import "github.com/aerogo/nano"
type Crash struct {
Error string `json:"error"`
Stack string `json:"stack"`
Path string `json:"path"`
hasID
hasCreator

View File

@ -36,6 +36,7 @@ func Recover(next aero.Handler) aero.Handler {
crash := &arn.Crash{
Error: err.Error(),
Stack: stackString,
Path: ctx.Path(),
}
crash.ID = arn.GenerateID("Crash")

View File

@ -8,6 +8,7 @@ component Crashes(crashes []*arn.Crash)
tr.mountable
td
a(href="/api/crash/" + crash.ID, target="_blank")= crash.Error
td= crash.Path
td
each line in strings.Split(crash.Stack, "\n")
p= line