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

log async ejs compile error to console

This commit is contained in:
s2
2020-02-07 20:50:01 +01:00
parent 23d46035e8
commit 6ed2b48d36
2 changed files with 10 additions and 6 deletions

View File

@@ -40,11 +40,15 @@
getTemplateFn.then(function(template) { getTemplateFn.then(function(template) {
var templateOptions = overwriteWithCacheOptions(options, templateUrl); var templateOptions = overwriteWithCacheOptions(options, templateUrl);
try {
$('#' + r).replaceWith(ejs.render( $('#' + r).replaceWith(ejs.render(
template, template,
data, data,
templateOptions templateOptions
)); ));
} catch(ex) {
console.error(templateUrl, ex);
}
//clean up the getFnFor //clean up the getFnFor
if (ejs.cache.remove && ejs.cache.get('getFnFor' + templateUrl)) { if (ejs.cache.remove && ejs.cache.get('getFnFor' + templateUrl)) {