mirror of
https://github.com/simon987/task_tracker.git
synced 2025-04-10 05:56:42 +00:00
22 lines
317 B
Go
22 lines
317 B
Go
package api
|
|
|
|
import (
|
|
"github.com/sirupsen/logrus"
|
|
"runtime/debug"
|
|
)
|
|
|
|
func handleErr(err error, r *Request) {
|
|
|
|
if err != nil {
|
|
logrus.Error(err.Error())
|
|
//debug.PrintStack()
|
|
|
|
r.Json(JsonResponse{
|
|
Message: err.Error(),
|
|
Content: ErrorResponse{
|
|
StackTrace: string(debug.Stack()),
|
|
},
|
|
}, 500)
|
|
}
|
|
}
|