Exception: Berkshelf::BerksfileReadError
- Inherits:
-
BerkshelfError
- Object
- StandardError
- BerkshelfError
- Berkshelf::BerksfileReadError
- Defined in:
- lib/berkshelf/errors.rb
Instance Method Summary collapse
- #backtrace ⇒ Object
-
#initialize(original_error) ⇒ BerksfileReadError
constructor
A new instance of BerksfileReadError.
- #original_backtrace ⇒ Object
- #status_code ⇒ Object
- #to_s ⇒ Object (also: #message)
Methods inherited from BerkshelfError
Constructor Details
#initialize(original_error) ⇒ BerksfileReadError
Returns a new instance of BerksfileReadError.
99 100 101 102 103 |
# File 'lib/berkshelf/errors.rb', line 99 def initialize(original_error) @original_error = original_error @error_message = original_error.to_s @error_backtrace = original_error.backtrace end |
Instance Method Details
#backtrace ⇒ Object
110 111 112 |
# File 'lib/berkshelf/errors.rb', line 110 def backtrace Array(@error_backtrace) + Array(original_backtrace) end |
#original_backtrace ⇒ Object
109 |
# File 'lib/berkshelf/errors.rb', line 109 alias_method :original_backtrace, :backtrace |
#status_code ⇒ Object
105 106 107 |
# File 'lib/berkshelf/errors.rb', line 105 def status_code @original_error.respond_to?(:status_code) ? @original_error.status_code : 113 end |
#to_s ⇒ Object Also known as: message
114 115 116 117 118 119 120 |
# File 'lib/berkshelf/errors.rb', line 114 def to_s [ "An error occurred while reading the Berksfile:", "", " #{@error_message}", ].join("\n") end |