Class: Cuprum::Cli::Errors::Files::TemplateError

Inherits:
Error
  • Object
show all
Defined in:
lib/cuprum/cli/errors/files/template_error.rb

Overview

Error returned when an error occurs when generating templated content.

Direct Known Subclasses

MissingParameter, TemplateNotResolved

Constant Summary collapse

TYPE =

Short string used to identify the type of error.

'cuprum.cli.errors.files.template_error'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message:, details: nil, template_name: nil) ⇒ TemplateError

Returns a new instance of TemplateError.

Parameters:

  • message (String)

    message describing the nature of the error.

  • details (String) (defaults to: nil)

    additional information about the error.

  • template_name (String) (defaults to: nil)

    the name of the rendered content, if any,



16
17
18
19
20
21
# File 'lib/cuprum/cli/errors/files/template_error.rb', line 16

def initialize(message:, details: nil, template_name: nil, **)
  @details       = details
  @template_name = template_name

  super
end

Instance Attribute Details

#detailsString (readonly)

Returns additional information about the error.

Returns:

  • (String)

    additional information about the error.



24
25
26
# File 'lib/cuprum/cli/errors/files/template_error.rb', line 24

def details
  @details
end

#template_nameString (readonly)

Returns the name of the rendered content, if any,.

Returns:

  • (String)

    the name of the rendered content, if any,



27
28
29
# File 'lib/cuprum/cli/errors/files/template_error.rb', line 27

def template_name
  @template_name
end