Hi Kanugula,

Am 08.03.2008 um 02:13 schrieb kanugula:

> The toString() version cuts the JSON object keys. It drops  
> origMessage also.

You're right, it doesn't include this information in the returned  
string. But there's no harm in that (see below).

> FF debug shows the response error object as
>
> class :"xxx.DuplicateDataException"
> code : 500
> message : "xxx.DuplicateDataException: Duplicate Data found"
> origMessage : "Duplicate Data found"
> origin :2
>
> The following code from Rpc.js modifies it
> var addToStringToObject = function(obj)

And? This code _adds_ a toString() method (which you don't have to  
use). All the original properties are left intact.

> In my opinion, we should return the original error unmodified.  
> There is no
> need to modify it.

Yes, there is. It's very convenient to be able to get a short string  
representation of the exception. Again, _nothing_ is taken away. I  
don't know where you got that idea. For example, I can do the  
following with an async call:

rpc.callAsync(
     function(result, exc) {
         if (exc != null) {
             alert(exc.origMessage);
         }
     }, "method", param1, param2);

And the following with a sync call:

try {
     var result = rpc.callSync("method", param1, param2);
} catch (e) {
     alert(e.rpcdetails.origMessage);
}

You can access all the properties of the original error (only  
origMessage is used in the above examples, but they're all there).

Regards,

   Andreas


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to