Skip to content

Commit ff1afb4

Browse files
committed
Warn and call onProcessError() for invalid JSON
Then rethrow
1 parent a7308da commit ff1afb4

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/loader/filetypes/JSONFile.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,18 @@ var JSONFile = new Class({
9898
{
9999
this.state = CONST.FILE_PROCESSING;
100100

101-
var json = JSON.parse(this.xhrLoader.responseText);
101+
try
102+
{
103+
var json = JSON.parse(this.xhrLoader.responseText);
104+
}
105+
catch (e)
106+
{
107+
console.warn('Invalid JSON: ' + this.key);
108+
109+
this.onProcessError();
110+
111+
throw e;
112+
}
102113

103114
var key = this.config;
104115

0 commit comments

Comments
 (0)