mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Handle parse errors in template file
This commit is contained in:
parent
7b0a1b2463
commit
3c176d0b94
@ -34,9 +34,12 @@ var node_scripts = [];
|
|||||||
function loadTemplate(templateFilename) {
|
function loadTemplate(templateFilename) {
|
||||||
return when.promise(function(resolve,reject) {
|
return when.promise(function(resolve,reject) {
|
||||||
whenNode.call(fs.readFile,templateFilename,'utf8').done(function(content) {
|
whenNode.call(fs.readFile,templateFilename,'utf8').done(function(content) {
|
||||||
registerConfig(content);
|
try {
|
||||||
|
registerConfig(content);
|
||||||
|
} catch(err) {
|
||||||
|
reject("invalid template file: "+err.message);
|
||||||
|
}
|
||||||
resolve();
|
resolve();
|
||||||
//console.log(templateFilename);
|
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
reject("missing template file");
|
reject("missing template file");
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user