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
Methods inherited from BerkshelfError
Constructor Details
#initialize(original_error) ⇒ BerksfileReadError
Returns a new instance of BerksfileReadError.
138 139 140 141 142 |
# File 'lib/berkshelf/errors.rb', line 138 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
151 152 153 |
# File 'lib/berkshelf/errors.rb', line 151 def backtrace Array(@error_backtrace) + Array(original_backtrace) end |
#original_backtrace ⇒ Object
150 |
# File 'lib/berkshelf/errors.rb', line 150 alias_method :original_backtrace, :backtrace |
#status_code ⇒ Object
146 147 148 |
# File 'lib/berkshelf/errors.rb', line 146 def status_code @original_error.respond_to?(:status_code) ? @original_error.status_code : 113 end |
#to_s ⇒ Object
155 156 157 158 159 160 161 |
# File 'lib/berkshelf/errors.rb', line 155 def to_s [ "An error occurred while reading the Berksfile:", "", " #{@error_message}", ].join("\n") end |