Class: Confium::ParseError

Inherits:
Error
  • Object
show all
Defined in:
lib/confium/errors/parse_error.rb

Overview

Raised when input cannot be parsed (bad JSON, malformed PEM, etc.).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, details_hash = nil, **kwargs) ⇒ ParseError

Returns a new instance of ParseError.



7
8
9
10
11
12
# File 'lib/confium/errors/parse_error.rb', line 7

def initialize(message = nil, details_hash = nil, **kwargs)
  message, kwargs = Confium::Errors::Coerce.args(message, details_hash, kwargs)
  @format = kwargs.delete(:format)
  @offset = kwargs.delete(:offset)
  super(message, details: { format: @format, offset: @offset, **kwargs })
end

Instance Attribute Details

#formatObject (readonly)

Returns the value of attribute format.



5
6
7
# File 'lib/confium/errors/parse_error.rb', line 5

def format
  @format
end

#offsetObject (readonly)

Returns the value of attribute offset.



5
6
7
# File 'lib/confium/errors/parse_error.rb', line 5

def offset
  @offset
end