-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
As a result of #1573 , we'll be able to report errors in a more standard format. It would be elegant to update the reporting of internal Showcase errors to be in this more standard format.
To do this just on the REST side, it seems we would need to update goviewcreator.go to read something like this:
file.P("func (backend *RESTBackend) ReportGRPCError(w http.ResponseWriter, err error) {")
file.P(" st, ok := status.FromError(err)")
file.P(" if !ok {")
file.P(` backend.Error(w, http.StatusInternalServerError, "** server error in ReportGRPCError: %%s\n---Error: %%+v\nStatus: %%+v\n", err.Error(), err, st)`)
file.P(` resttools.ErrorResponse(w, resttools.NoCodeHTTP, codes.Internal, "non-gRPC error", errdetails.ErrorInfo{Reason: err.Error(), Domain: "showcase server"})`)
file.P(" return")
file.P(" }")(The line right before the return statement is the new one.)
However, we should also report these more stamdard errors over gRPC transport.
Moreover this has implications for existing Showcase unit tests and possibly for generator repositories which may depend on Showcase, so we should proceed with care.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.