On Sun, Nov 1, 2009 at 18:22, panyasan <[email protected]> wrote:

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

Heh. Don't blame us for that mess! :-)


>
> 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>
>

PHP doesn't return errors with such a tab as <phpfatalerror> in any version
of PHP I've ever used. Since there's a tag, but it's not a valid HTML tag,
it must be XML, right? :-) Actually, qx.io.remote.transport.XmlHttp only
takes the response to be XML if the response type is application/xml. Do
you, or does PHP, ever specify such a thing?


> 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,
>

Yes, but only as described above.


> which gets added a toString() method by the "addToStringToObject()"
> function
>

Yes, but that's much later than deciding if it's XML or not. The toString
method isn't added until the repsonse gets all the back up into the Rpc
layer.


> -- 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?
>

Likely what needs changing is the fact that the response is XML. Rpc doesn't
know anything about XML and will have great trouble dealing with it.

Derrell
------------------------------------------------------------------------------
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