Method: Hocon::Impl::Parseable#parse_document_from_origin

Defined in:
lib/hocon/impl/parseable.rb

#parse_document_from_origin(origin, final_options) ⇒ Object



209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/hocon/impl/parseable.rb', line 209

def parse_document_from_origin(origin, final_options)
  begin
    raw_parse_document(origin, final_options)
  rescue IOError => e
    if final_options.allow_missing?
      Hocon::Impl::SimpleConfigDocument.new(
        Hocon::Impl::ConfigNodeObject.new([]), final_options)
    else
      self.class.trace("exception loading #{origin.description}: #{e.class}: #{e.message}")
      raise ConfigIOError.new(origin, "#{e.class.name}: #{e.message}", e)
    end
  end
end