-
Notifications
You must be signed in to change notification settings - Fork 65
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
chore: Improve error handling #1275
Conversation
/retest |
Signed-off-by: Anatolii Bazko <[email protected]>
Signed-off-by: Anatolii Bazko <[email protected]>
Signed-off-by: Anatolii Bazko <[email protected]>
1183467
to
3d068b9
Compare
Signed-off-by: Anatolii Bazko <[email protected]>
/retest |
1 similar comment
/retest |
|
||
export function newError(message: string, cause: Error): Error { | ||
const error = new Error(message) | ||
error.stack += `\nCause: ${cause.stack}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably we should preserve original error message too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original message is included in cause.stack
@@ -111,8 +111,11 @@ export class E2eHelper { | |||
// Return id of test workspaces(e2e-tests. Please look devfile-example.yaml file) | |||
async getWorkspaceId(): Promise<any> { | |||
const workspaces = await this.getAllWorkspaces() | |||
const workspaceId = workspaces.filter((wks => wks.name.match(this.devfileName))).map(({ id }) => id)[0] | |||
if (workspaces.length === 0) { | |||
throw Error('Workspace not found') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, but since we introducing newError
method we should use it. Otherwise it might be a mess of new Error(...)
and new Error()
calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new function is introduced to preserver an original stack trace and message.
So, not for this case
Signed-off-by: Anatolii Bazko <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mmorhun, tolusha The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Anatolii Bazko [email protected]
What does this PR do?
cannot read property 'statusCode' of undefined
errorScreenshot/screencast of this PR
What issues does this PR fix or reference?
eclipse-che/che#19916
How to test this PR?
N/A
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.