Skip to main content

Errors and Exit Status

Errors and Exit Status

Current Runtime Behavior

Interpret parser feedback, structured validation labels, pipeline failures, subprocess errors, and current process status.

Commandcusty COMMAND

Category

Reference

Quick Command

status + message + optional diagnostic label

exit 0exit 1usage 2ValidationError

Process Status Reference​

Current Status Behavior

0 - successful completionA command or pipeline reached its normal completion boundary without an uncaught failure.
1 - explicit or application failureUsed by Custy validators, progress wrappers, root no-command behavior, and most uncaught application exceptions.
2 - command-line usage errorTyper/Click uses this for unknown commands, unknown options, missing required values, and invalid parameter input.
Subprocess statusGit, Commitizen, or editor commands have their own return codes. Custy may wrap, normalize, log, or re-raise those failures rather than expose the same numeric value.

Error Families

How Failures Surface

CLI parsingTyper explains the invalid command, option, enum, tag, or missing argument before command execution begins.
ConfigurationErrorInvalid TOML, an unreadable configuration file, a required missing property, or an invalid project-source directory.
ValidationErrorA workflow precondition with a message, optional hint, diagnostic label, default exit_code of 1, and optional context.
GitOperationErrorA repository operation failed at the high-level Git service boundary.
BranchCleanupErrorBranch cleanup could not evaluate or delete an eligible branch; protected and deletion failures have dedicated subclasses.
Pipeline failureThe active progress UI identifies the failing step, stops execution, and re-raises the original exception.
External tool failureGit, Commitizen, or a configured editor could not be launched or returned an unsuccessful result.
Unexpected exceptionTyper's pretty-exception behavior or Python traceback reports an unhandled implementation failure.

Structured Validation Labels

The active workflow and commit validator attach labels such as:

  • Repository and remotes: NOT_GIT_REPO, REMOTE_NOT_FOUND, MAIN_REMOTE_MISSING.
  • Files and editor: VERSION_FILE_NOT_FOUND, COMMIT_MSG_PATH_MISSING, COMMIT_MSG_FILE_NOT_FOUND, TAG_MSG_PATH_MISSING, TAG_MSG_FILE_NOT_FOUND, EDITOR_LAUNCH_FAILED, EDITOR_PROCESS_FAILED.
  • Commit content: EMPTY_COMMIT_MSG, INVALID_COMMIT_FORMAT, INVALID_COMMIT_TYPE, COMMIT_MESSAGE_MISSING, COMMITIZEN_NOT_CONFIGURED, COMMITIZEN_NOT_AVAILABLE, COMMITIZEN_CONFIGURATION_INVALID, COMMITIZEN_CHECK_FAILED, COMMITIZEN_FAILED.
  • Staging: EMPTY_STAGING_ABORTED, NO_STAGED_FILES, NO_STAGED_CHANGES, INVALID_STAGE_MODE, AUTO_STAGE_FAILED, STAGING_FAILED.
  • Version and tag: INVALID_VERSION_INPUT, TAG_MISSING, TAG_CREATION_FAILED.
  • Publication and finalization: GIT_COMMIT_FAILED, GIT_HOOK_FAILED, COMMIT_FAILED, PUSH_FAILED, PUSH_TAG_FAILED, POST_WORKFLOW_FAILED.

Pipeline Failure Boundary

Pipelines are sequential and non-transactional. When a step fails:

  1. The active pipeline reports the step name.
  2. Execution stops before later steps run.
  3. The exception is re-raised.
  4. Earlier file, Git, backup, commit, tag, or remote effects are not automatically reversed.

Inspect git status, recent commits, tags, remotes, generated files, backups, and logs/custy.log before retrying.


Automation Pattern

PowerShell
powershell
custy --no-banner validate
if ($LASTEXITCODE -ne 0) {
  throw "Custy validation failed with exit code $LASTEXITCODE"
}

Use --no-banner for compact output and a UTF-8-capable capture stream. Do not use root --help or --version as zero-status health checks with the current implementation.


Continue