Exception: Pakyow::UnknownType

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

Instance Attribute Summary

Attributes inherited from Error

#context, #wrapped_exception

Instance Method Summary collapse

Methods inherited from Error

build, #cause, #condensed_backtrace, #details, #initialize, #name, new_with_message, #path, #project?

Constructor Details

This class inherits a constructor from Pakyow::Error

Instance Method Details

#contextual_messageObject



61
62
63
64
65
66
67
68
69
70
71
# File 'lib/pakyow/errors.rb', line 61

def contextual_message
  known_types = @context[:types].each_with_object(String.new) { |known_type, known_types_message|
    known_types_message << "  - #{known_type.inspect}\n"
  }

  <<~MESSAGE
    Try using one of these known types:

    #{known_types}
  MESSAGE
end