1 package graphql 2 3 import ( 4 "context" 5 "fmt" 6 "os" 7 "runtime/debug" 8 9 "github.com/vektah/gqlparser/v2/gqlerror" 10 ) 11 12 type RecoverFunc func(ctx context.Context, err interface{}) (userMessage error) 13 14 func DefaultRecover(ctx context.Context, err interface{}) error { 15 fmt.Fprintln(os.Stderr, err) 16 fmt.Fprintln(os.Stderr) 17 debug.PrintStack() 18 19 return gqlerror.Errorf("internal system error") 20 } 21