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

feat(scan): include exit code and reason in JSON result #555

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion safety/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,18 @@ def get_config_setting(name: str) -> Optional[str]:
EXIT_CODE_MALFORMED_DB = 69
EXIT_CODE_INVALID_PROVIDED_REPORT = 70
EXIT_CODE_INVALID_REQUIREMENT = 71
EXIT_CODE_EMAIL_NOT_VERIFIED = 72
EXIT_CODE_EMAIL_NOT_VERIFIED = 72

EXIT_CODE_REASON_MAPPING = {
EXIT_CODE_OK: "No vulnerabilities found.",
EXIT_CODE_FAILURE: "General failure.",
EXIT_CODE_VULNERABILITIES_FOUND: "Vulnerabilities found.",
EXIT_CODE_INVALID_API_KEY: "Invalid API key.",
EXIT_CODE_TOO_MANY_REQUESTS: "Too many requests.",
EXIT_CODE_UNABLE_TO_LOAD_LOCAL_VULNERABILITY_DB: "Unable to load local vulnerability database.",
EXIT_CODE_UNABLE_TO_FETCH_VULNERABILITY_DB: "Unable to fetch vulnerability database.",
EXIT_CODE_MALFORMED_DB: "Malformed vulnerability database.",
EXIT_CODE_INVALID_PROVIDED_REPORT: "Invalid provided report.",
EXIT_CODE_INVALID_REQUIREMENT: "Invalid requirement.",
EXIT_CODE_EMAIL_NOT_VERIFIED: "Email not verified."
}
Loading
Loading