Exception: Typstify::CompileError
- Defined in:
- lib/typstify/errors.rb
Overview
The Typst compiler rejected the document. Carries the compiler's own annotated diagnostic, which points at the offending line.
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
-
#typst_message ⇒ Object
readonly
Returns the value of attribute typst_message.
Instance Method Summary collapse
-
#initialize(template:, typst_message:, line: nil, column: nil) ⇒ CompileError
constructor
A new instance of CompileError.
Constructor Details
#initialize(template:, typst_message:, line: nil, column: nil) ⇒ CompileError
Returns a new instance of CompileError.
36 37 38 39 40 41 42 43 |
# File 'lib/typstify/errors.rb', line 36 def initialize(template:, typst_message:, line: nil, column: nil) @template = template @typst_message = @line = line @column = column location = line ? " (line #{line}#{", column #{column}" if column})" : "" super("Typst failed to compile #{template}#{location}:\n\n#{}") end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
34 35 36 |
# File 'lib/typstify/errors.rb', line 34 def column @column end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
34 35 36 |
# File 'lib/typstify/errors.rb', line 34 def line @line end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
34 35 36 |
# File 'lib/typstify/errors.rb', line 34 def template @template end |
#typst_message ⇒ Object (readonly)
Returns the value of attribute typst_message.
34 35 36 |
# File 'lib/typstify/errors.rb', line 34 def @typst_message end |