Exception: Cliqr::Error::CliqrError Private
- Inherits:
-
StandardError
- Object
- StandardError
- Cliqr::Error::CliqrError
- Defined in:
- lib/cliqr/error.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Base error class that others error types extend from
Direct Known Subclasses
CommandRuntimeError, ConfigNotFound, DuplicateActions, DuplicateOptions, IllegalArgumentError, IllegalCommandError, InvocationError, MultipleOptionValues, OptionValueMissing, UnknownActionError, UnknownCommandOption, UnknownCommandRunnerException, UnknownValidatorType, ValidationError
Class Attribute Summary collapse
-
.error_code ⇒ Integer
private
The error code based on the error condition.
Instance Method Summary collapse
-
#initialize(error_message, cause = nil) ⇒ CliqrError
constructor
private
Set up the error to wrap another error’s trace.
-
#message ⇒ String
private
Build a error message based on the cause of the error.
-
#to_s ⇒ String
private
Get string representation of the error.
Constructor Details
#initialize(error_message, cause = nil) ⇒ CliqrError
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set up the error to wrap another error’s trace
22 23 24 25 26 27 28 29 30 |
# File 'lib/cliqr/error.rb', line 22 def initialize(, cause = nil) super cause @error_message = @cause = cause # Preserve the original exception's data if provided set_backtrace cause.backtrace if cause? end |
Class Attribute Details
.error_code ⇒ Integer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The error code based on the error condition
13 14 15 |
# File 'lib/cliqr/error.rb', line 13 def error_code @error_code end |
Instance Method Details
#message ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Build a error message based on the cause of the error
35 36 37 38 39 40 41 |
# File 'lib/cliqr/error.rb', line 35 def if cause? "#{@error_message}\n\nCause: #{@cause.class} - #{@cause.}\n" else @error_message end end |
#to_s ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Get string representation of the error
46 47 48 |
# File 'lib/cliqr/error.rb', line 46 def to_s end |