Exception: HatiConfig::TypeCheckerError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/hati_config/errors.rb

Overview

Custom error raised when a type definition is missing.

Examples:

Raising a TypeCheckerError

raise TypeCheckerError.new(:unknown_type)
# => raises TypeCheckerError with message "No type Definition for: <unknown_type> type"

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ TypeCheckerError

Initializes a new TypeCheckerError.

Parameters:

  • type (Symbol) —

    The type that is missing a definition.



39
40
41
# File 'lib/hati_config/errors.rb', line 39

def initialize(type)
  super(definition_error_msg(type))
end

Instance Method Details

#definition_error_msg(type) ⇒ String

Generates the error message for the exception.

Parameters:

  • type (Symbol) —

    The type that is missing a definition.

Returns:

  • (String) —

    The formatted error message.



47
48
49
# File 'lib/hati_config/errors.rb', line 47

def definition_error_msg(type)
  "No type Definition for: <#{type}> type"
end