core/DB.js
function (clt_name, op, err, onFail, is_exception) {

	var msg = 'DB ' + op + ' error for [' + clt_name + ']';
	LOG.error(msg, 'SR.DB');
	LOG.error(err, 'SR.DB');
	if (typeof err.stack !== 'undefined') {
		LOG.error(err.stack, 'SR.DB');
		msg += ('\n\n' + err.stack);
	}
	UTIL.safeCall(onFail, err);

	if (is_exception) {
		return;
	}

	// notify project admin if it's not code exception
	// NOTE: only project admins are notified
	UTIL.notifyAdmin(
		'[SR DB error: ' + clt_name + ']',
		msg
	);
}
function (clt_name, op, err, onFail, is_exception) {

	var msg = 'DB ' + op + ' error for [' + clt_name + ']';
	LOG.error(msg, 'SR.DB');
	LOG.error(err, 'SR.DB');
	if (typeof err.stack !== 'undefined') {
		LOG.error(err.stack, 'SR.DB');
		msg += ('\n\n' + err.stack);
	}
	UTIL.safeCall(onFail, err);

	if (is_exception) {
		return;
	}

	// notify project admin if it's not code exception
	// NOTE: only project admins are notified
	UTIL.notifyAdmin(
		'[SR DB error: ' + clt_name + ']',
		msg
	);
}
function ( clt_name , op , err , onFail , is_exception ) { var msg = 'DB ' + op + ' error for [' + clt_name + ']' ; LOG . error ( msg , 'SR.DB' ) ; LOG . error ( err , 'SR.DB' ) ; if ( typeof err . stack !== 'undefined' ) { LOG . error ( err . stack , 'SR.DB' ) ; msg += ( '\n\n' + err . stack ) ; } UTIL . safeCall ( onFail , err ) ; if ( is_exception ) { return ; } // notify project admin if it's not code exception // NOTE: only project admins are notified UTIL . notifyAdmin ( '[SR DB error: ' + clt_name + ']' , msg ) ; }
helper to notify DB error
helper to notify DB error