Browse Source

rpdata-server: Fixed unhelpful error message being returned on panic.

module-madness-pointers
Gisle Aune 6 years ago
parent
commit
17fd3c60f8
  1. 3
      cmd/rpdata-server/main.go

3
cmd/rpdata-server/main.go

@ -75,11 +75,10 @@ func queryHandler() http.HandlerFunc {
handler := handler.GraphQL( handler := handler.GraphQL(
graph2.New(), graph2.New(),
handler.RecoverFunc(func(ctx context.Context, err interface{}) error { handler.RecoverFunc(func(ctx context.Context, err interface{}) error {
// send this panic somewhere
log.Println(err) log.Println(err)
log.Println(string(debug.Stack())) log.Println(string(debug.Stack()))
return fmt.Errorf("shit")
return fmt.Errorf("The server failed to serve your request due to an internal error, it has been logged")
}), }),
) )

Loading…
Cancel
Save