← Back to issue list

Use predefined exit codes

View original Github issue

Metadata

Project
craft-application
Number
#379
Type
issue
State
open
Author
mattculler
Labels
Created
2024-07-09 19:42:54+00:00
Updated
2025-05-23 17:26:50+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### What needs to get done In `application.py` (as well as `errors.py` and `services/remotebuild.py`) there are hardcoded constants that refer to `sysexits.h`. These constants are already defined in the python standard library under `os`: https://docs.python.org/3/library/os.html#os.EX_OK More pedantic, less important: `PartsError` and `ProviderError` both exit 1 - whether these are changed to something more distinctive or not, these should be defined publically, so the values can be used in unit tests. `CraftError` exits an overrideable value that it defines internally as defaulting to 1, this can also be exposed for tests. ### Why it needs to get done Using predefined values is better practice than using magic numbers with explanatory comments.

Evaluation history

No evaluation history available.