Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var _doInitWidget = function() {
try
{
if (widget.initWidget) {
widget.initWidget(config);
}
else {
OriginalWidgetClass.call(widget, config);
}
}
catch(e) {
var message = 'Unable to initialize widget of type "' + type + '". Exception: ' + e;
// NOTE:
// For widgets rendered on the server we disable errors from bubbling to allow the page to possibly function
// in a partial state even if some of the widgets fail to initialize.
// For widgets rendered on the client we enable bubbling to make sure calling code is aware of the error.
if (bubbleErrorsDisabled) {
logger.error(message, e);
}
else {
throw e;
}
}