Exception: TypstRails::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/typst_rails/renderer.rb

Overview

Error class for Typst-related errors.

Raised when Typst compilation fails, when files cannot be created, or when other Typst-specific errors occur during rendering.

Examples:

Handling Typst errors

begin
  renderer.render(nil, data)
rescue TypstRails::Error => e
  Rails.logger.error "Typst compilation failed: #{e.message}"
  render plain: "PDF generation failed", status: 500
end