Exception: DoiExtractor::CommandFailError
- Inherits:
-
StandardError
- Object
- StandardError
- DoiExtractor::CommandFailError
- Defined in:
- lib/doi_extractor/errors.rb
Instance Attribute Summary collapse
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
-
#inner_exception ⇒ Object
readonly
Returns the value of attribute inner_exception.
Instance Method Summary collapse
- #error_report ⇒ Object
-
#initialize(message, inner_exception = nil, exit_code = 1) ⇒ CommandFailError
constructor
A new instance of CommandFailError.
Constructor Details
#initialize(message, inner_exception = nil, exit_code = 1) ⇒ CommandFailError
Returns a new instance of CommandFailError.
7 8 9 10 11 |
# File 'lib/doi_extractor/errors.rb', line 7 def initialize(, inner_exception = nil, exit_code = 1) super() @inner_exception = inner_exception @exit_code = exit_code end |
Instance Attribute Details
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code.
5 6 7 |
# File 'lib/doi_extractor/errors.rb', line 5 def exit_code @exit_code end |
#inner_exception ⇒ Object (readonly)
Returns the value of attribute inner_exception.
5 6 7 |
# File 'lib/doi_extractor/errors.rb', line 5 def inner_exception @inner_exception end |
Instance Method Details
#error_report ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/doi_extractor/errors.rb', line 13 def error_report report = [] report << "Failed: #{self.}" if inner_exception report << "caused by: #{inner_exception.class}: #{inner_exception.}" inner_exception.backtrace.each do |l| report << " #{l}" end end report << ' ' report.join("\n") end |