-
Notifications
You must be signed in to change notification settings - Fork 883
feat(error): add structured exit codes for scriptable error handling #428
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
jpoehnelt
merged 3 commits into
googleworkspace:main
from
abhiram304:feat/structured-exit-codes
Mar 12, 2026
+147
−1
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
933add1
feat(error): add structured exit codes for scriptable error handling
abhiram304 71d1ae4
refactor(error): replace magic exit-code numbers with named constants
abhiram304 be31c31
refactor(error): centralize exit code help text via EXIT_CODE_DOCUMEN…
abhiram304 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| "@googleworkspace/cli": minor | ||
| --- | ||
|
|
||
| Add structured exit codes for scriptable error handling | ||
|
|
||
| `gws` now exits with a type-specific code instead of always using `1`: | ||
|
|
||
| | Code | Meaning | | ||
| |------|---------| | ||
| | `0` | Success | | ||
| | `1` | API error — Google returned a 4xx/5xx response | | ||
| | `2` | Auth error — credentials missing, expired, or invalid | | ||
| | `3` | Validation error — bad arguments, unknown service, invalid flag | | ||
| | `4` | Discovery error — could not fetch the API schema document | | ||
| | `5` | Internal error — unexpected failure | | ||
|
|
||
| Exit codes are documented in `gws --help` and in the README. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.