Skip to content

[server] remove gitpod support mention from errors #19045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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