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

View File

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