rem: return "Code " + this.code + ": " + this.message; 
add: switch(origin) { case qx.io.remote.Rpc.origin.server: return "Server error " + this.code + ": " + this.message; case qx.io.remote.Rpc.origin.application: return "Application error " + this.code + ": " + this.message; case qx.io.remote.Rpc.origin.transport: return "Transport error " + this.code + ": " + this.message; case qx.io.remote.Rpc.origin.local: return "Local error " + this.code + ": " + this.message; default: return "UNEXPECTED origin " + this.origin + " error " + this.code + ": " + this.message; } 
context: qx.Proto._callInternal = function(args, async) {  var offset = 0;  var handler = args[0];  if (async) {    offset = 1;  }  var whichMethod = args[offset];  var argsArray = [];  for (var i = offset + 1; i < args.length; ++i) {    argsArray.push(args[i]);  }  var req = new qx.io.remote.RemoteRequest(this.getUrl(),                                           qx.constant.Net.METHOD_POST,                                           qx.constant.Mime.JSON);  var requestObject = {    "service": this.getServiceName(),    "method": whichMethod,    "id": req.getSequenceNumber(),    "params": argsArray    // additional field 'server_data' optionally included, below  };  // See if there's any out-of-band data to be sent to the server  var serverData = this.getServerData();  if (serverData !== undefined) {    // There is.  Send it.    requestObject.server_data = serverData;  }  req.setCrossDomain(this.getCrossDomain());  req.setTimeout(this.getTimeout());  var ex = null;  var id = null;  var result = null;  var handleRequestFinished = function() {    if (async) {      handler(result, ex, id);    }  };    var makeException = function(code, message) {    var ex = new Object();    ex.code = code;    if (message) {      ex.message = message;    } else {      ex.message = qx.io.remote.RemoteExchange.statusCodeToString(code);    }    ex.toString = function() {      return "Code " + this.code + ": " + this.message;    };    return ex;  };    req.addEventListener("failed", function(evt) {    ex = makeException(evt.getData().getStatusCode(), null);    id = this.getSequenceNumber();    handleRequestFinished();  });  req.addEventListener("timeout", function(evt) {    ex = makeException(408, "Local time-out expired");    id = this.getSequenceNumber();    handleRequestFinished();  });  req.addEventListener("aborted", function(evt) {    ex = makeException(409, "Aborted");    id = this.getSequenceNumber();    handleRequestFinished();  });  req.addEventListener("completed", function(evt) {    result = evt.getData().getContent();    id = result["id"];    if (id != this.getSequenceNumber()) {      this.warn("Received id (" + this.getSequenceNumber() + ") does not match requested id (" + id + ")!");    }    var exTest = result["error"];    if (exTest != null) {      result = null;      ex = makeException(this.code, this.message);    } else {      result = result["result"];    }    handleRequestFinished();  });  req.setData(qx.io.Json.stringify(requestObject));  req.setAsynchronous(async);  if (req.getCrossDomain()) {    // Our choice here has no effect anyway.  This is purely informational.    req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  } else {    // When not cross-domain, set type to text/json    req.setRequestHeader("Content-Type", "text/json");  }  req.send();  if (!async) {      if (ex != null) {        throw ex;      }      return result;  } else {    return req;  }};
meta: 1005	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1005/f238f93acb7d7ea2e90a2c8c0eb7381a8729c3f8/Rpc.js/buggy/qooxdoo/source/script/qx/io/remote/Rpc.js