View Full Version : Ext.Direct - Exception handling question

16 Sep 2009, 4:04 AM
I've written a plugin for the Zend Framework that is able to stack multiple requests - if Ext merges multiple request into one, the Plugin is able to recognize this and processes each individually.
However, its unclear to me how to handle an exception that gets thrown _before_ the processing starts.
Let's say Ext merges 3 requests into one.
Zend framework gets the request, sees that 3 requests have been merged into one and splits them to process each individually. Now what happens is, that the very first request which holds the stack triggers an error before the stack gets processed. Do I have to send 3 Exceptions holding the "tid" back or is it okay if I only send one exception back, without the "tid"s?

18 Sep 2009, 10:31 AM
Direct expects that you will send back 3 exceptions and tie each to a tId.

This is because Direct manages all transactions currently in the queue which have not been responded to. While sending back a simple exception will currently cause the exception to fire, the transactions will still be maintained in the queue.

It would make sense to enhance Direct to drop all transactions which were last sent if the exception responded without a tId. We might look into putting this into a future release.

18 Sep 2009, 7:31 PM
Thanks, this was helpful. My controller plugin already copies exceptions under the individual tid's so that was the way I expected it without going through the source.

Another thing - and you might want to point me to the feature request forum here - is it possible to add more configuration properties to the various actions? For example, a property that tells if I a request to an action may be merged with other requests? The reason is, there are actions that are called under the same url but some of them do some expensive operations and I don't want to mix them with requests that usually return within a second...