Hello Andreas,

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

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)
      {
        obj.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);
          }
        };
      };

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

Thank you.
Kanugula.

Andreas Junghans wrote:
> 
> Hi,
> 
> Am 08.03.2008 um 01:22 schrieb Derrell Lipman:
> 
>> On Fri, Mar 7, 2008 at 5:22 PM, kanugula  
>> <[EMAIL PROTECTED]> wrote:
>>>
>>>  Hello,
>>>
>>>  Version:qooxd00-0.7.3
>>>
>>>  In case of RPC Service exception, I get a stringified version of  
>>> remote
>>>  exception as per Rpc.js.
>>>
>>>  I need to build a user-friendly error message instead of the  
>>> format built by
>>>  Rpc.addToStringToObject.
>>>
>>>  It looks like there is no handle to response["error"] from the  
>>> client.
>>>
>>>  Is there any way you can add this feature in Rpc.js?
>>
>> I've checked the change in locally.  I'm currently unable to
>> authenticate with sourceforge to check it in, but as soon as
>> sourceforge is working again, you'll have it.
> 
> IMHO this change is unnecessary and should not be commited. You get  
> full access to the exception object in the handler function for async  
> calls, and it's available as the property "rpcdetails" when an  
> exception is thrown during a sync call.
> 
> @Kanugula: I don't know why you think that only a stringified version  
> of the original error is available. A toString() method is _added_ to  
> the error object as a convenience, but all the original properties  
> are still 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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Where-is-the-handle-to-RPC-response-original-exception--tp15907759p15909869.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


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