diff --git a/ejs-render-remote.js b/ejs-render-remote.js index ed93530..860ad5c 100644 --- a/ejs-render-remote.js +++ b/ejs-render-remote.js @@ -66,7 +66,13 @@ $.get(templateUrl) .then(function(template) { 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); d.resolve(templateUrl);