output stack in errors
This commit is contained in:
@@ -12,6 +12,14 @@ import (
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
)
|
||||
|
||||
func errorObject(err error) bson.M {
|
||||
o := bson.M{"error": err.Error()}
|
||||
if e, ok := err.(*mgocrud.ErrorWithStack); ok {
|
||||
o["stack"] = e.Stack()
|
||||
}
|
||||
return o
|
||||
}
|
||||
|
||||
func modelTypeOf(m interface{}) reflect.Type {
|
||||
return reflect.TypeOf(
|
||||
reflect.ValueOf(m).Elem().Interface(),
|
||||
|
||||
Reference in New Issue
Block a user