Exception: Domainic::Command::ExecutionError

Inherits:
Error
  • Object
show all
Defined in:
lib/domainic/command/errors/execution_error.rb

Overview

Error class raised when a command encounters an execution failure. This class provides access to both the error message and the Result object containing detailed information about the failure.

Examples:

Handling execution errors

begin
  command.call!
rescue Domainic::Command::ExecutionError => e
  puts e.message           # Access the error message
  puts e.result.errors     # Access the detailed errors
  puts e.result.status_code # Access the status code
end

Since:

  • 0.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, result) ⇒ void

Creates a new execution error with the given message and result

Since:

  • 0.1.0

Parameters:

  • The error message describing what went wrong

  • The result object containing detailed failure information



34
35
36
37
# File 'lib/domainic/command/errors/execution_error.rb', line 34

def initialize(message, result)
  @result = result
  super(message)
end

Instance Attribute Details

#resultResult (readonly)

The Result object containing detailed information about the execution failure

Since:

  • 0.1.0

Returns:

  • The result object associated with the failure



25
26
27
# File 'lib/domainic/command/errors/execution_error.rb', line 25

def result
  @result
end