Skip to content

Exit Codes

Source of truth: src/assync/commands/_common.py. Every CLI command shares this contract — expected domain errors print a clean message and exit with a stable code, never a raw stack trace; unexpected errors still exit non-zero.

Code Meaning
0 Success
1 Unexpected / internal error
2 Invalid input
3 Not found
4 Authorization denied
5 Blocked
6 Conflict or lock
7 Adapter failure
8 Validation failure

Error-to-exit-code mapping

Error Exit code
RecordNotFound 3 (Not found)
AuthorizationDenied 4 (Authorization denied)
LockConflictError 6 (Conflict or lock)
AdapterExecutionError 7 (Adapter failure)
ValidationError 8 (Validation failure)
StateTransitionError 8 (Validation failure)
StorageError 8 (Validation failure)
SynthesisError 8 (Validation failure)
any other ValueError 2 (Invalid input)
anything else unhandled 1 (Unexpected / internal error)