Exception: Calyx::Errors::UnsupportedFormat

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/calyx/errors.rb

Overview

Raised when the client attempts to load a grammar with an unsupported file extension. Only ‘.json` and `.yml` are valid.

Calyx::Grammar.load("grammar.toml")
# => Calyx::Errors::UnsupportedFormat: grammar.toml is not a valid JSON or YAML file

Instance Method Summary collapse

Constructor Details

#initialize(msg) ⇒ UnsupportedFormat

Returns a new instance of UnsupportedFormat.



62
63
64
# File 'lib/calyx/errors.rb', line 62

def initialize(msg)
  super("#{File.basename(msg)} is not a valid JSON or YAML file")
end