Exception: Calyx::Errors::UnsupportedFormat
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- Calyx::Errors::UnsupportedFormat
- 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
-
#initialize(msg) ⇒ UnsupportedFormat
constructor
A new instance of UnsupportedFormat.
Constructor Details
#initialize(msg) ⇒ UnsupportedFormat
Returns a new instance of UnsupportedFormat.
41 42 43 |
# File 'lib/calyx/errors.rb', line 41 def initialize(msg) super("#{File.basename(msg)} is not a valid JSON or YAML file") end |