Output full stacktrace for errors when debugging
This commit is contained in:
parent
7f0ea653b8
commit
2a35485089
1 changed files with 4 additions and 1 deletions
5
db/db.go
5
db/db.go
|
@ -20,6 +20,8 @@ import (
|
|||
|
||||
"net/http"
|
||||
|
||||
"runtime/debug"
|
||||
|
||||
"github.com/abcum/fibre"
|
||||
"github.com/abcum/surreal/cnf"
|
||||
"github.com/abcum/surreal/kvs"
|
||||
|
@ -196,7 +198,8 @@ func (e *executor) execute(quit <-chan bool, send chan<- *Response) {
|
|||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
if err, ok := r.(error); ok {
|
||||
fmt.Println(err)
|
||||
log.WithPrefix("db").Errorln(err)
|
||||
log.WithPrefix("db").Debugln(string(debug.Stack()))
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
|
Loading…
Reference in a new issue