Hi,

this one is for Derrell and Andreas, the authors of qx.io.remote.Rpc.

in RpcConsole, I am handling an error result from a qx.io.remote.Rpc call
like so:

      this.__failedListener = rpc.addListenerOnce("failed", function(e){
          this.__sendButton.setEnabled(true);
          this.__cancelButton.setEnabled(false);
          var error = e.getData();
          this.handleError( error.toString() );  
          this.cancelRequest();
      },this);

When the PHP service methods crashes with an uncatcheable fatal error, which
produces the following output: 

<phpfatalerror>
Fatal error: Call to undefined function adsfadasf() in
/Users/bibliograph/Sites/Bibliograph/RpcPhp/trunk/services/server/ServiceIntrospection.php
on line 167
</phpfatalerror>

The content of the e.getData() -- on FF3.5/Mac -- is typeof = "xml", and
error.toString() produces the following result: 
<error>
  <toString>function () {
    switch (obj.origin) {
      case qx.io.remote.Rpc.origin.server:
        return "Server error " + obj.code + ": " + obj.message;
      case qx.io.remote.Rpc.origin.application:
        return "Application error " + obj.code + ": " + obj.message;
      case qx.io.remote.Rpc.origin.transport:
        return "Transport error " + obj.code + ": " + obj.message;
      case qx.io.remote.Rpc.origin.local:
        return "Local error " + obj.code + ": " + obj.message;
      default:
        return "UNEXPECTED origin " + obj.origin + " error " + obj.code + ":
" + obj.message;
    }
}</toString>
</error>

It seems like the object returned to qx.io.remote.Rpc is an XML object,
which gets added a toString() method by the "addToStringToObject()" function
-- however, the original error message is no longer available to the handler
code. Somewhat bizarre to the uninitiated. Any idea how this coudl be
changed?

Thanks,

Christian 


-- 
View this message in context: 
http://n2.nabble.com/Interesting-rpc-error-tp3928879p3928879.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to