Skip to content
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

[dashboard/server] app error conversion based on error details #19103

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

akosyakov
Copy link
Member

@akosyakov akosyakov commented Nov 21, 2023

Description

This PR:

  • unifies API errors on server by consistently using ApplicationError
  • drops http headers to encode/decode errors instead use gRPC error details
  • delete dead errors and code
Summary generated by Copilot

🤖[deprecated] Generated by Copilot at 9e624aa

Refactored and improved the error handling logic in the server and dashboard components, using new subclasses of ApplicationError with protobuf messages and predefined error codes. Removed unused code and props related to errors.

Related Issue(s)

Fixes #

How to test

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft preemptible
    Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@akosyakov
Copy link
Member Author

akosyakov commented Nov 21, 2023

/gh run recreate-vm=true

Comment triggered a workflow run

Started workflow run: 6949222385

  • recreate_vm: true

@akosyakov
Copy link
Member Author

akosyakov commented Nov 22, 2023

/gh run recreate-vm=true

Comment triggered a workflow run

Started workflow run: 6955542072

  • recreate_vm: true

@akosyakov akosyakov force-pushed the ak/app_error_conversion branch from 77afcbf to 84c824e Compare November 22, 2023 11:56
@roboquat roboquat added size/XXL and removed size/XL labels Nov 22, 2023
@akosyakov akosyakov marked this pull request as ready for review November 22, 2023 11:56
@akosyakov akosyakov requested a review from a team as a code owner November 22, 2023 11:56
@akosyakov akosyakov force-pushed the ak/app_error_conversion branch from 84c824e to 39651e3 Compare November 22, 2023 14:42
@AlexTugarev
Copy link
Member

AlexTugarev commented Nov 22, 2023

Testing:
✔️ "Repo not found" on private repo => CTA "Grant access" => Start work with private repo

✔️ Errors in parsed config
Screenshot 2023-11-22 at 15 51 27

✔️ Missing OAuth approval from repo owner
Screenshot 2023-11-22 at 15 52 48

const data = <UnauthorizedError.Data>{ host, scopes, messageHint: messageHint || "unauthorized" };
const error = Object.assign(new Error(message), { data });
return error;
return new UnauthorizedRepositoryAccessError({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for providing a smooth transitioning path! 🙇🏻
This feels great! Not touching the call sites but still converting 👍🏻

@akosyakov akosyakov force-pushed the ak/app_error_conversion branch from 39651e3 to 6453026 Compare November 22, 2023 15:34
Copy link
Member

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️ the relevant use cases worked fine!
Awesome code change! Very clean transition path 👏🏻

@akosyakov
Copy link
Member Author

/unhold

@roboquat roboquat merged commit 70517fb into main Nov 22, 2023
14 of 15 checks passed
@roboquat roboquat deleted the ak/app_error_conversion branch November 22, 2023 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants