Exception: Ea::Transformations::Parsers::ParseError
- Defined in:
- lib/ea/transformations/parsers/base_parser.rb
Overview
Custom error class for parsing failures
Instance Attribute Summary collapse
-
#file_path ⇒ String
readonly
Path to file that failed to parse.
-
#original_error ⇒ StandardError
readonly
Original error that caused parsing failure.
-
#parser ⇒ BaseParser
readonly
Parser instance that failed.
Instance Method Summary collapse
-
#details ⇒ Hash
Get detailed error information.
-
#initialize(message, original_error: nil, parser: nil, file_path: nil) ⇒ ParseError
constructor
Initialize parsing error.
Constructor Details
#initialize(message, original_error: nil, parser: nil, file_path: nil) ⇒ ParseError
Initialize parsing error
456 457 458 459 460 461 462 463 464 |
# File 'lib/ea/transformations/parsers/base_parser.rb', line 456 def initialize( , original_error: nil, parser: nil, file_path: nil ) super() @original_error = original_error @parser = parser @file_path = file_path end |
Instance Attribute Details
#file_path ⇒ String (readonly)
Returns Path to file that failed to parse.
448 449 450 |
# File 'lib/ea/transformations/parsers/base_parser.rb', line 448 def file_path @file_path end |
#original_error ⇒ StandardError (readonly)
Returns Original error that caused parsing failure.
442 443 444 |
# File 'lib/ea/transformations/parsers/base_parser.rb', line 442 def original_error @original_error end |
#parser ⇒ BaseParser (readonly)
Returns Parser instance that failed.
445 446 447 |
# File 'lib/ea/transformations/parsers/base_parser.rb', line 445 def parser @parser end |
Instance Method Details
#details ⇒ Hash
Get detailed error information
469 470 471 472 473 474 475 476 477 478 |
# File 'lib/ea/transformations/parsers/base_parser.rb', line 469 def details # rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity { message: , file_path: @file_path, parser: @parser&.class&.name, original_error: @original_error&.class&.name, original_message: @original_error&., backtrace: @original_error&.backtrace&.first(5), } end |