Module: Domainic::Command::Result::STATUS

Defined in:
lib/domainic/command/result/status.rb

Overview

Defines status codes for command execution results. These codes follow Unix exit code conventions, making them suitable for CLI applications while remaining useful for other contexts.

The status codes are specifically chosen to provide meaningful feedback about where in the command lifecycle a failure occurred:

  • 0 (SUCCESS) - The command completed successfully
  • 1 (FAILED_AT_RUNTIME) - The command failed during execution
  • 2 (FAILED_AT_INPUT) - The command failed during input validation
  • 3 (FAILED_AT_OUTPUT) - The command failed during output validation

Examples:

Using with CLI

class MyCLI
  def self.run
    result = MyCommand.call(args)
    exit(result.status_code)
  end
end

Author:

Since:

  • 0.1.0

Constant Summary collapse

SUCCESS =

Indicates successful command execution

Returns:

  • (Integer)

    status code 0

Since:

  • 0.1.0

0
FAILED_AT_RUNTIME =

Indicates a failure during command execution

Returns:

  • (Integer)

    status code 1

Since:

  • 0.1.0

1
FAILED_AT_INPUT =

Indicates a failure during input validation

Returns:

  • (Integer)

    status code 2

Since:

  • 0.1.0

2
FAILED_AT_OUTPUT =

Indicates a failure during output validation

Returns:

  • (Integer)

    status code 3

Since:

  • 0.1.0

3