Method: Sentry::Attachment#payload

Defined in:
lib/sentry/attachment.rb

#payloadObject



20
21
22
23
24
25
26
27
28
# File 'lib/sentry/attachment.rb', line 20

def payload
  @payload ||= if bytes
    bytes
  else
    File.binread(path)
  end
rescue Errno::ENOENT
  raise PathNotFoundError, "Failed to read attachment file, file not found: #{path}"
end