Enable stack trace logging
This commit is contained in:
parent
52620fa9ce
commit
ba9f348e1c
1 changed files with 3 additions and 0 deletions
3
db/db.go
3
db/db.go
|
@ -18,6 +18,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"runtime/debug"
|
||||||
|
|
||||||
"github.com/abcum/fibre"
|
"github.com/abcum/fibre"
|
||||||
"github.com/abcum/surreal/cnf"
|
"github.com/abcum/surreal/cnf"
|
||||||
"github.com/abcum/surreal/kvs"
|
"github.com/abcum/surreal/kvs"
|
||||||
|
@ -121,6 +123,7 @@ func execute(ctx *fibre.Context, ast *sql.Query, chn chan<- interface{}) {
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
if err, ok := r.(error); ok {
|
if err, ok := r.(error); ok {
|
||||||
|
fmt.Printf("%s", debug.Stack())
|
||||||
chn <- err
|
chn <- err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue