github.com/humans-group/gqlgen@v0.7.2/graphql/recovery.go (about) 1 package graphql 2 3 import ( 4 "context" 5 "errors" 6 "fmt" 7 "os" 8 "runtime/debug" 9 ) 10 11 type RecoverFunc func(ctx context.Context, err interface{}) (userMessage error) 12 13 func DefaultRecover(ctx context.Context, err interface{}) error { 14 fmt.Fprintln(os.Stderr, err) 15 fmt.Fprintln(os.Stderr) 16 debug.PrintStack() 17 18 return errors.New("internal system error") 19 }