Skip to content

@miripiruni miripiruni released this Sep 26, 2017 · 97 commits to master since this release

When you use production option with true value you can define function for custom error logging. This function will be used instead of regilar console.error. Custom function will be filled with two arguments:

  1. Object with block, element and modifiers fields where error occurred.
  2. Original JS error.

You can define custom onError function by extending prototype of BEMContext. For example:

var bemxjst = require('bem-xjst');
var templates = bemxjst.bemhtml.compile('', { production: true });

templates.BEMContext.prototype.onError = function(context, err) { … };
Assets 2
You can’t perform that action at this time.