Introduce app-specific error codes to Gitpod
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.8k
- Forks
- 1.4k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 5
Description
Context / Motivation
There are many ways that Gitpod can error. In many cases we are showing raw stack traces, very technical errors to users or in some cases (invalid context URL errors) the workspace and IDE can hang completely. These errors often result in quite scary, red and cryptic looking error messages (e.g. stack traces or internal function call information) and often miss an opportunity to provide guidance to our users about what they can do to fix the error. This is particularly prevalent during workspace start / opening a workspace.
This issue proposes introducing application-specific error codes.
What is an app specific error code?
- A Gitpod defined string such as
project_not_found,auth_no_permission - Codes are typically quite coarse-grained so we don't have 100's
- Codes can be namespaced / prefixed according to our needs (here be dragons 🐉 )
- The code causing the error might change, but the codes do not
- Codes are centrally defined in a dictionary (in docs)
- When new behaviour is added to the product, new codes are considered
- Codes can be mapped to longer descriptions which describe the error, descriptions live centrally
- Inside the application, all logic is wrapped, and emit only known error codes
- If a known error cannot be found, an unknown error code is shown and is tracked and logged
Purpose
The purpose of having application specific error codes is:
- The key of the error code can be referenced in documentation and error reports
- The occurrences + frequency of the error can be tracked as a product analytics
- Any undefined error codes or failure states can be tracked (any errors without an app specific error code)
- The error code can be used in future audit logs for users or organisations when debugging (without trawling logs)
- Error code descriptions, and suggested actions can live separate to the application code (e.g. in a CMS) where non-technical individuals can experiment with different messages to users, pointing to relevant documentation pages, or providing different user actions.
Scope
- Define a technical standard for application specific error codes used throughout Gitpod
- Define a dictionary (preferably in the public documentation that references each error code, what it means and potential mitigation actions or solutions).
- Implement minimal first few set of error codes, before gradually rolling out to the rest of the application
Example potential error codes / states
invalid_context_url(e.g. #11854)
Example implementations, links and "best practices" / standards
- https://stripe.com/docs/error-codes
- https://auth0.com/docs/libraries/common-auth0-library-authentication-errors
- https://jsonapi.org/format/#error-objects
| Example 1 | Example 2 |
|---|---|
![]() |
![]() |
| Example 3 | Example 4 |
|---|---|
![]() |
![]() |
| Example 5 | Example 6 |
|---|---|
![]() |
![]() |
| Example 7 |
|---|
![]() |
| Example 8 | - |
|---|---|
Relates to:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not identify files, tests, or entry points to change. Start by defining the application error-code standard and the centrally maintained documentation dictionary, then determine the initial error cases and integration boundaries; done means the standard, dictionary, and minimal first implementation are agreed and documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend-api-design, documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100






