Pardon me if this is a newbie question: I have implemented an Ext.Direct handler on my ASP.NET website and I am able to successfully call it from my Sencha Touch 2 application. When I make the call to the Ext.Direct server method, I pass a callback function that takes two parameters: 'data' and 'trans'.
I am now trying to implement error handling in the callback function. When no server exception occurs, the return value of the server method is received in 'data'. When a server exception does occur, 'data' is null and the Chrome debugger shows that the '_message' member of the 'trans' object contains an error message. I can't find any documentation of the 'trans' parameter and how to properly use it for error detection and handling. Could someone point me to the appropriate documentation?
Thanks. I looked up Ext.direct.Transaction in the docs and found it described as a 'Supporting Class for Ext.Direct (not intended to be used directly)'. This makes me think I shouldn't use it in my code.
While looking at the Ext.direct docs, I noticed Ext.direct.ExceptionEvent which is described as 'An event that is fired when an exception is received from a Ext.direct.RemotingProvider'. This looks promising. Should I use this to detect exceptions in the server method? If so, is there any sample code that demonstrates how to register for the event and properly handle it?