Exception: HexaPDF::MalformedPDFError
- Defined in:
- lib/hexapdf/error.rb
Overview
Raised when the PDF is invalid and can’t be read correctly.
Instance Attribute Summary collapse
-
#pos ⇒ Object
The byte position in the PDF file where the error occured.
Instance Method Summary collapse
-
#initialize(message, pos: nil) ⇒ MalformedPDFError
constructor
Creates a new malformed PDF error object for the given exception message.
-
#message ⇒ Object
:nodoc:.
Constructor Details
#initialize(message, pos: nil) ⇒ MalformedPDFError
Creates a new malformed PDF error object for the given exception message.
The byte position where the error occured can either be given via the pos
argument or later via the #pos accessor but must be set before the exception message is retrieved.
52 53 54 55 |
# File 'lib/hexapdf/error.rb', line 52 def initialize(, pos: nil) super() @pos = pos end |
Instance Attribute Details
#pos ⇒ Object
The byte position in the PDF file where the error occured.
46 47 48 |
# File 'lib/hexapdf/error.rb', line 46 def pos @pos end |
Instance Method Details
#message ⇒ Object
:nodoc:
57 58 59 |
# File 'lib/hexapdf/error.rb', line 57 def # :nodoc: "PDF malformed around position #{pos}: #{super}" end |