Stack traces are only useful for panics

This commit is contained in:
Howl 2016-06-16 14:05:26 +02:00
parent 6554447cbc
commit 02f0449b39
1 changed files with 3 additions and 4 deletions

View File

@ -18,6 +18,8 @@ func Recovery(client *raven.Client, onlyCrashes bool) gin.HandlerFunc {
var requestBody []byte
defer func() {
st := raven.NewStacktrace(0, 3, []string{"git.zxq.co/ripple"})
tokenRaw, ex := c.Get("token")
var token string
if ex {
@ -29,8 +31,6 @@ func Recovery(client *raven.Client, onlyCrashes bool) gin.HandlerFunc {
ravenHTTP.Data = string(requestBody)
}
stackTrace := raven.NewStacktrace(0, 3, []string{"git.zxq.co/ripple"})
ravenUser := &raven.User{
ID: token,
IP: c.Request.RemoteAddr,
@ -54,7 +54,7 @@ func Recovery(client *raven.Client, onlyCrashes bool) gin.HandlerFunc {
client.CaptureError(
err,
flags,
stackTrace,
st,
ravenHTTP,
ravenUser,
)
@ -69,7 +69,6 @@ func Recovery(client *raven.Client, onlyCrashes bool) gin.HandlerFunc {
client.CaptureError(
err,
flags,
stackTrace,
ravenHTTP,
ravenUser,
)