Class: CemAcpt::Bolt::Cmd::OutputError
- Inherits:
-
Object
- Object
- CemAcpt::Bolt::Cmd::OutputError
- Defined in:
- lib/cem_acpt/bolt/cmd/output.rb
Overview
Represents a Bolt error value
Instance Attribute Summary collapse
-
#details ⇒ Object
Returns the value of attribute details.
-
#issue_code ⇒ Object
Returns the value of attribute issue_code.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#msg ⇒ Object
Returns the value of attribute msg.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #backtrace ⇒ Object
- #error? ⇒ Boolean
- #exit_code ⇒ Object
-
#initialize(error_hash) ⇒ OutputError
constructor
A new instance of OutputError.
- #inspect ⇒ Object
- #status ⇒ Object
- #success? ⇒ Boolean
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(error_hash) ⇒ OutputError
Returns a new instance of OutputError.
267 268 269 270 271 272 273 |
# File 'lib/cem_acpt/bolt/cmd/output.rb', line 267 def initialize(error_hash) @error_hash = error_hash @kind = error_hash['kind'] @issue_code = error_hash['issue_code'] || 'OTHER_ERROR' @msg = error_hash['msg'] @details = error_hash['details'] end |
Instance Attribute Details
#details ⇒ Object
Returns the value of attribute details.
265 266 267 |
# File 'lib/cem_acpt/bolt/cmd/output.rb', line 265 def details @details end |
#issue_code ⇒ Object
Returns the value of attribute issue_code.
265 266 267 |
# File 'lib/cem_acpt/bolt/cmd/output.rb', line 265 def issue_code @issue_code end |
#kind ⇒ Object
Returns the value of attribute kind.
265 266 267 |
# File 'lib/cem_acpt/bolt/cmd/output.rb', line 265 def kind @kind end |
#msg ⇒ Object
Returns the value of attribute msg.
265 266 267 |
# File 'lib/cem_acpt/bolt/cmd/output.rb', line 265 def msg @msg end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
307 308 309 310 311 |
# File 'lib/cem_acpt/bolt/cmd/output.rb', line 307 def ==(other) return false unless other.is_a?(self.class) to_h == other.to_h end |
#backtrace ⇒ Object
291 292 293 |
# File 'lib/cem_acpt/bolt/cmd/output.rb', line 291 def backtrace details['backtrace'] || [] end |
#error? ⇒ Boolean
275 276 277 |
# File 'lib/cem_acpt/bolt/cmd/output.rb', line 275 def error? true end |
#exit_code ⇒ Object
287 288 289 |
# File 'lib/cem_acpt/bolt/cmd/output.rb', line 287 def exit_code details['exit_code'] || 1 end |
#inspect ⇒ Object
299 300 301 |
# File 'lib/cem_acpt/bolt/cmd/output.rb', line 299 def inspect "#<#{self.class.name}(#{self.class.object_id})#{self}>" end |
#status ⇒ Object
283 284 285 |
# File 'lib/cem_acpt/bolt/cmd/output.rb', line 283 def status 'failure' end |
#success? ⇒ Boolean
279 280 281 |
# File 'lib/cem_acpt/bolt/cmd/output.rb', line 279 def success? false end |
#to_h ⇒ Object
303 304 305 |
# File 'lib/cem_acpt/bolt/cmd/output.rb', line 303 def to_h @error_hash end |
#to_s ⇒ Object
295 296 297 |
# File 'lib/cem_acpt/bolt/cmd/output.rb', line 295 def to_s "issue code: #{issue_code}, kind: #{kind}, message: #{msg}" end |