public/js/data.js
function ajaxCallback(data, textStatus) {
            //responses should be a list of successful responses
            //if any request failed it *may or may not* be an http-level error
            //depending on server-side implementation
           // konsole.log("datarequest", data, textStatus, 'dbdata.'+txnId, comment);
            if (textStatus == 'success') {
                data.getErrors = function() {
                  if (this.error) return [this.error];
                  var errors = [];
                  for (var i=0; i < this.length; i++) {
                    if (this[i].error)
                      errors.push(this[i].error);
                  }
                  return errors;
                };
                data.hasErrors = function() { return this.getErrors().length > 0;}
                if (false !== $(elem).triggerHandler('dbdata-'+txnId, [data, request, comment])) {
                  $(elem).trigger('dbdata', [data, request, comment]);
                }
            } else {
                //when textStatus != 'success', data param will be a XMLHttpRequest obj
                var errorObj = {"jsonrpc": "2.0", "id": null,
                  "error": {"code": -32000,
                        "message": data.statusText || textStatus,
                        'data' : data.responseText
                  },
                  hasErrors: function() { return true;},
                  getErrors: function() { return [this.error];}
                };
                if (false !== $(elem).triggerHandler('dbdata-'+txnId, [errorObj, request, comment])) {
                  $(elem).trigger('dbdata', [errorObj, request, comment]);
                }
            }
         }
function ajaxCallback(data, textStatus) {
            //responses should be a list of successful responses
            //if any request failed it *may or may not* be an http-level error
            //depending on server-side implementation
           // konsole.log("datarequest", data, textStatus, 'dbdata.'+txnId, comment);
            if (textStatus == 'success') {
                data.getErrors = function() {
                  if (this.error) return [this.error];
                  var errors = [];
                  for (var i=0; i < this.length; i++) {
                    if (this[i].error)
                      errors.push(this[i].error);
                  }
                  return errors;
                };
                data.hasErrors = function() { return this.getErrors().length > 0;}
                if (false !== $(elem).triggerHandler('dbdata-'+txnId, [data, request, comment])) {
                  $(elem).trigger('dbdata', [data, request, comment]);
                }
            } else {
                //when textStatus != 'success', data param will be a XMLHttpRequest obj
                var errorObj = {"jsonrpc": "2.0", "id": null,
                  "error": {"code": -32000,
                        "message": data.statusText || textStatus,
                        'data' : data.responseText
                  },
                  hasErrors: function() { return true;},
                  getErrors: function() { return [this.error];}
                };
                if (false !== $(elem).triggerHandler('dbdata-'+txnId, [errorObj, request, comment])) {
                  $(elem).trigger('dbdata', [errorObj, request, comment]);
                }
            }
         }
function ajaxCallback ( data , textStatus ) { //responses should be a list of successful responses //if any request failed it *may or may not* be an http-level error //depending on server-side implementation // konsole.log("datarequest", data, textStatus, 'dbdata.'+txnId, comment); if ( textStatus == 'success' ) { data . getErrors = function ( ) { if ( this . error ) return [ this . error ] ; var errors = [ ] ; for ( var i = 0 ; i < this . length ; i ++ ) { if ( this [ i ] . error ) errors . push ( this [ i ] . error ) ; } return errors ; } ; data . hasErrors = function ( ) { return this . getErrors ( ) . length > 0 ; } if ( false !== $ ( elem ) . triggerHandler ( 'dbdata-' + txnId , [ data , request , comment ] ) ) { $ ( elem ) . trigger ( 'dbdata' , [ data , request , comment ] ) ; } } else { //when textStatus != 'success', data param will be a XMLHttpRequest obj var errorObj = { "jsonrpc" : "2.0" , "id" : null , "error" : { "code" : - 32000 , "message" : data . statusText || textStatus , 'data' : data . responseText } , hasErrors : function ( ) { return true ; } , getErrors : function ( ) { return [ this . error ] ; } } ; if ( false !== $ ( elem ) . triggerHandler ( 'dbdata-' + txnId , [ errorObj , request , comment ] ) ) { $ ( elem ) . trigger ( 'dbdata' , [ errorObj , request , comment ] ) ; } } }
var clientErrorMsg = this.clientErrorMsg;
var clientErrorMsg = this . clientErrorMsg ;