Better error reporting when a grammar fails to load

This commit is contained in:
Corey Johnson
2012-11-05 11:10:49 -08:00
committed by Corey Johnson & Nathan Sobo
parent f6b5b4d3bd
commit 5535d37a3e

View File

@@ -9,6 +9,7 @@ class TextMateGrammar
plist.parseString fs.read(path), (e, data) ->
throw new Error(e) if e
grammar = new TextMateGrammar(data[0])
throw new Error("Failed to load grammar at path `#{path}`") unless grammar
grammar
name: null