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:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user