Method: Dap::Input::InputJSON#read_record

Defined in:
lib/dap/input.rb

#read_recordObject



61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/dap/input.rb', line 61

def read_record
  line = self.fd.readline rescue nil
  return Error::EOF unless line
  begin
    json = Oj.load(line.strip, mode: :strict)
  rescue
    $stderr.puts "Record is not valid JSON and will be skipped: '#{line.chomp}'"
    return Error::InvalidFormat
  end
  return Error::Empty unless json
  json
end