Exception: Reek::Errors::EncodingError
- Defined in:
- lib/reek/errors/encoding_error.rb
Overview
Gets raised when Reek is unable to process the source due to an EncodingError
Constant Summary collapse
- TEMPLATE =
"Source '%<source>s' cannot be processed by Reek due to an encoding error in the source file."
- LONG_TEMPLATE =
<<-MESSAGE !!! %<message>s This is a problem that is outside of Reek's scope and should be fixed by you, the user, in order for Reek being able to continue. Check out this article for an idea on how to get started: https://www.justinweiss.com/articles/3-steps-to-fix-encoding-problems-in-ruby/ Exception message: %<exception>s Original backtrace: %<original>s !!! MESSAGE
Instance Method Summary collapse
-
#initialize(origin:) ⇒ EncodingError
constructor
A new instance of EncodingError.
- #long_message ⇒ Object
Constructor Details
#initialize(origin:) ⇒ EncodingError
Returns a new instance of EncodingError.
31 32 33 |
# File 'lib/reek/errors/encoding_error.rb', line 31 def initialize(origin:) super(format(TEMPLATE, source: origin)) end |
Instance Method Details
#long_message ⇒ Object
35 36 37 38 39 40 |
# File 'lib/reek/errors/encoding_error.rb', line 35 def format(LONG_TEMPLATE, message: , exception: cause.inspect, original: cause.backtrace.join("\n\t")) end |