mirror of
https://github.com/S2-/ejs-render-remote
synced 2025-08-02 12:40:04 +02:00
log async ejs compile error to console
This commit is contained in:
@@ -40,11 +40,15 @@
|
|||||||
getTemplateFn.then(function(template) {
|
getTemplateFn.then(function(template) {
|
||||||
var templateOptions = overwriteWithCacheOptions(options, templateUrl);
|
var templateOptions = overwriteWithCacheOptions(options, templateUrl);
|
||||||
|
|
||||||
$('#' + r).replaceWith(ejs.render(
|
try {
|
||||||
template,
|
$('#' + r).replaceWith(ejs.render(
|
||||||
data,
|
template,
|
||||||
templateOptions
|
data,
|
||||||
));
|
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)) {
|
||||||
|
@@ -1 +1 @@
|
|||||||
Hello <%= name%>!
|
Hello <%= name %>!
|
||||||
|
Reference in New Issue
Block a user