Skip to content
Docs GitHub

Exit Codes

The CLI uses semantic exit codes so scripts, CI pipelines, and AI agents can react to failure categories without parsing stderr.

RangeCategoryDescription
0SuccessCommand completed successfully
1GeneralUnexpected or unclassified error
10–19AuthAuthentication and authorization failures
20–29InputConfiguration, validation, and resolution errors
30–39APISentry API and network errors
40–49FeatureFeature availability and billing issues
50–59OperationsUpgrade and OAuth flow errors
60–69CommandCommand-specific non-standard exits
CodeNameDescription
0SuccessCommand completed successfully
1General ErrorUnexpected error or unclassified failure
10Not AuthenticatedNo credentials found — run sentry auth login
11Token ExpiredAuth token expired — re-authenticate
12Token InvalidAuth token rejected by the server
13Host ScopeRequest blocked — credentials don't match the target host
20Config ErrorConfiguration or DSN problem
21Validation ErrorInvalid input (malformed ID, bad flag value, etc.)
22Missing ContextRequired context (org, project) could not be determined
23Not FoundA user-provided identifier could not be resolved
30API ErrorSentry API returned an error response
31TimeoutOperation exceeded its time limit
40Seer Not EnabledSeer is not enabled for the organization
41Seer No BudgetSeer requires a paid plan
42AI DisabledAI features disabled by organization admin
50Upgrade ErrorCLI upgrade operation failed
51Device Flow ErrorOAuth device authorization flow failed
60Output ErrorCommand produced output but the operation failed
61Wizard ErrorInteractive setup wizard encountered an error
62Wizard DepsWizard dependency installation failed
63Wizard CodemodWizard codemod plan or apply failed
64Wizard VerifyUser stopped wizard after verification step
Terminal window
sentry issue list my-org/
code=$?
case $code in
0) echo "Success" ;;
1?) echo "Auth problem (code $code) — run: sentry auth login" ;;
2?) echo "Input/config problem (code $code)" ;;
3?) echo "API/network error (code $code)" ;;
4?) echo "Feature not available (code $code)" ;;
*) echo "Failed with exit code $code" ;;
esac
import subprocess
result = subprocess.run(["sentry", "issue", "list", "my-org/"], capture_output=True)
if result.returncode == 0:
print("Success")
elif 10 <= result.returncode <= 19:
print("Auth error — run: sentry auth login")
elif 20 <= result.returncode <= 29:
print("Input/config error")
elif 30 <= result.returncode <= 39:
print("API/network error")
elif 40 <= result.returncode <= 49:
print("Feature not available")
  • Exit codes below 128 are safe from collision with Unix signal exits (128+N).
  • The sentry api command renders API error responses to stdout and exits with code 60 (Output Error), not 30 (API Error). This matches the gh api convention — the error response body is useful output. Parse the HTTP status from --verbose output or the JSON error body if you need to distinguish API error categories.
  • The sentry init wizard maps its internal workflow exit codes to CLI exit codes: platform not detected → 20 (Config), dependency install failed → 62 (Wizard Deps), codemod failed → 63 (Wizard Codemod), verification stopped → 64 (Wizard Verify), other → 61 (Wizard).
  • Stricli (the CLI framework) uses negative exit codes (-5 to -1) for framework-level errors like unknown commands or invalid arguments. These appear as 251–255 in unsigned form.