class HexaPDF::MalformedPDFError

Raised when the PDF is invalid and can’t be read correctly.

def initialize(message, pos: nil)

via the #pos accessor but must be set before the exception message is retrieved.
The byte position where the error occured can either be given via the +pos+ argument or later

Creates a new malformed PDF error object for the given exception message.
def initialize(message, pos: nil)
  super(message)
  @pos = pos
end

def message # :nodoc:

:nodoc:
def message # :nodoc:
  "PDF malformed around position #{pos}: #{super}"
end