Skip to content

Commit

Permalink
[server] remove gitpod support mention from errors (#19045)
Browse files Browse the repository at this point in the history
  • Loading branch information
akosyakov authored Nov 9, 2023
1 parent df7929c commit b786da1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/server/src/api/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class API {
if (reason != err && err.code === Code.Internal) {
log.error("public api: unexpected internal error", reason);
err = new ConnectError(
`Oops! Something went wrong. Please quote the request ID ${logContext.requestId} when reaching out to Gitpod Support.`,
`Oops! Something went wrong.`,
Code.Internal,
// pass metadata to preserve the application error
err.metadata,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,9 @@ class GitpodJsonRpcProxyFactory<T extends object> extends JsonRpcProxyFactory<T>
observeAPICallsDuration(method, 200, timer());
return result;
} catch (e) {
const requestIdMessage = ` If this error is unexpected, please quote the request ID '${requestId}' when reaching out to Gitpod Support.`;
// TODO(ak) this guard does not look correct
// it checks for a presence of `code`, but other errors also may have code, like all Node.js errors: https://nodejs.org/api/errors.html#errorcode
// instanceof ApplicationError should be more appropriate here
if (ApplicationError.hasErrorCode(e)) {
increaseApiCallCounter(method, e.code);
observeAPICallsDuration(method, e.code, timer());
Expand All @@ -463,13 +465,13 @@ class GitpodJsonRpcProxyFactory<T extends object> extends JsonRpcProxyFactory<T>
message: e.message,
},
);
throw new ResponseError(e.code, e.message + requestIdMessage, e.data);
throw new ResponseError(e.code, e.message, e.data);
} else {
TraceContext.setError(ctx, e); // this is a "real" error

const err = new ApplicationError(
ErrorCodes.INTERNAL_SERVER_ERROR,
`Internal server error: '${e.message}'` + requestIdMessage,
`Internal server error: '${e.message}'`,
);
increaseApiCallCounter(method, err.code);
observeAPICallsDuration(method, err.code, timer());
Expand Down

0 comments on commit b786da1

Please sign in to comment.