Exception: Typstify::MissingTemplate

Inherits:
Error
  • Object
show all
Defined in:
lib/typstify/errors.rb

Overview

The template could not be found as either .typ or .typ.erb.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template, tried) ⇒ MissingTemplate

Returns a new instance of MissingTemplate.



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/typstify/errors.rb', line 12

def initialize(template, tried)
  @template = template
  @tried = tried
  super(<<~MSG.strip)
    Could not find a Typst template for #{template.inspect}.

    Tried:
    #{tried.map { |p| "  - #{p}" }.join("\n")}

    Templates live under Typstify.config.template_root
    (#{Typstify.config.template_root}).
  MSG
end

Instance Attribute Details

#templateObject (readonly)

Returns the value of attribute template.



10
11
12
# File 'lib/typstify/errors.rb', line 10

def template
  @template
end

#triedObject (readonly)

Returns the value of attribute tried.



10
11
12
# File 'lib/typstify/errors.rb', line 10

def tried
  @tried
end