PdfEx.Error (pdf_ex v0.1.0)

Copy Markdown View Source

The single error struct returned across the public API.

Every malformed-input or edit failure surfaces as {:error, %PdfEx.Error{reason: atom(), message: String.t()}} — the library never raises on bad files. reason is a stable atom for matching; message is human-readable context.

Summary

Types

reason()

@type reason() ::
  :not_a_pdf
  | :malformed_xref
  | :missing_startxref
  | :malformed_object
  | :unsupported_filter
  | :circular_reference
  | :object_not_found
  | :decompression_failed
  | atom()

t()

@type t() :: %PdfEx.Error{message: String.t(), reason: reason()}

Functions

new(reason, message \\ "")

@spec new(reason(), String.t()) :: t()