debug a promise

debug a promise

I have some old code I am trying to get to work.  The debugger stops where it can't load the user template on the error line below with asterisks.  I'm guessing the problem is in the promise.  Can I just take out some lines on the promise to force it to work for a demo to make it more straightforward?  I don't have any data just a default user in the model.  Don't need it to be in a promise.  One thing I haven't figured out is this line " if(debug && window.console) "   I don't know if debug is on or off.  I don't know where that is reference. 

_loadTemplateAsync = function(tmpId, type){
var promise = '', ext = '.js';
if(type == 'html') {
ext = '.html';
}
else if(type == 'js') {
ext = '.js';
}
   promise = promises[tmpId] || $.get(_template_dir + tmpId + ext).error(function () {
    if(debug && window.console) {
    console.log('Cannot load the ' + tmpId + ' view.');          ********************************
    }
   });
   promises[tmpId] = promise;
   return promise;
};
return {
// Use jQuery to asynchronously load the template. 
loadTemplate : function(templateId, templateType, callback){
var tmpId = templateId.replace("#", "");
   var promise = _loadTemplateAsync(tmpId, templateType);
   promise.done(function(template){
    callback.call(this, $(template));
   });
}
};
  
})();