1
0
mirror of https://github.com/S2-/ejs-render-remote synced 2025-08-02 12:40:04 +02:00

when compile throws an exception, log it to the console

This commit is contained in:
s2
2020-02-07 17:26:35 +01:00
parent 8c9f23ce3f
commit 1c720ce9f3

View File

@@ -66,7 +66,13 @@
$.get(templateUrl) $.get(templateUrl)
.then(function(template) { .then(function(template) {
var templateOptions = overwriteWithCacheOptions(options, templateUrl); var templateOptions = overwriteWithCacheOptions(options, templateUrl);
var templateFn = ejs.compile(template, templateOptions); try {
var templateFn = ejs.compile(template, templateOptions);
} catch(ex) {
console.error(templateUrl, ex);
d.reject(ex);
throw ex;
}
ejs.cache.set(templateUrl, templateFn); ejs.cache.set(templateUrl, templateFn);
d.resolve(templateUrl); d.resolve(templateUrl);