1
0
mirror of https://github.com/S2-/ejs-render-remote synced 2025-08-02 04:30: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) {
var templateOptions = overwriteWithCacheOptions(options, templateUrl);
$('#' + r).replaceWith(ejs.render(
template,
data,
templateOptions
));
try {
$('#' + r).replaceWith(ejs.render(
template,
data,
templateOptions
));
} catch(ex) {
console.error(templateUrl, ex);
}
//clean up the getFnFor
if (ejs.cache.remove && ejs.cache.get('getFnFor' + templateUrl)) {

View File

@@ -1 +1 @@
Hello <%= name%>!
Hello <%= name %>!