Enable stack trace logging

This commit is contained in:
Tobie Morgan Hitchcock 2016-07-21 22:49:47 +01:00
parent 52620fa9ce
commit ba9f348e1c

View file

@ -18,6 +18,8 @@ import (
"fmt"
"time"
"runtime/debug"
"github.com/abcum/fibre"
"github.com/abcum/surreal/cnf"
"github.com/abcum/surreal/kvs"
@ -121,6 +123,7 @@ func execute(ctx *fibre.Context, ast *sql.Query, chn chan<- interface{}) {
defer func() {
if r := recover(); r != nil {
if err, ok := r.(error); ok {
fmt.Printf("%s", debug.Stack())
chn <- err
}
}