PDA

View Full Version : [CLOSED] Communication failure



feanor91
Jan 10, 2013, 2:08 PM
Hello

How could I avoid this message to be broadcast on ajax request? I already put a longuer timeout on store, ii there another thing I can do?

Daniil
Jan 10, 2013, 2:11 PM
Hi @feanor91,

Please clarify do you want to determine the reason of this message or just suppress it?

If the first, we need more details.

If the second, please try to set up ShowWarningOnFailure="false" for the Store.

feanor91
Jan 10, 2013, 2:24 PM
I just want to suppress it, because I think the root cause is I ask to much to the server, but I play with timeout and it seems to work better. I had a lot of directmethod call too and "ShowWarningOnFailure" not exists on that.

Daniil
Jan 10, 2013, 2:28 PM
To suppress globally:

<ext:ResourceManager runat="server" ShowWarningOnAjaxFailure="false" />

Please note that it will suppress warning of any failure Ext.NET AJAX requests.

There is the AjaxRequestException listener of ResourceManager. You could handle it and suppress a warning only if there is "Communication failure" in a response.

feanor91
Jan 10, 2013, 2:46 PM
How!

This is this kind of information in Ext.Net book? I have bought it, but just read the begining now.

Using this parameter allow to handle Failure function on direct method call for example?

What is this parameter for : RethrowAjaxExceptions="True"?

Daniil
Jan 10, 2013, 5:17 PM
This is this kind of information in Ext.Net book? I have bought it, but just read the begining now.


There is something about handling exceptions. I don't remember what exactly... But it is definitely worth to read.

It is in the AJAX chapter.


Using this parameter allow to handle Failure function on direct method call for example?

Yes, setting up an AjaxRequestException listener, you are able to handle all failure DirectEvent and DirectMethod request.


What is this parameter for : RethrowAjaxExceptions="True"?

Somewhere in Ext.NET we catch exceptions using the try-catch blocks. Setting RethrowAjaxExceptions to true rethrows those exceptions from "catch" sections. It can be useful for handling exceptions globally, for example, in Global.asax.

feanor91
Jan 10, 2013, 7:26 PM
Somewhere in Ext.NET we catch exceptions using the try-catch blocks. Setting RethrowAjaxExceptions to true rethrows those exceptions from "catch" sections. It can be useful for handling exceptions globally, for example, in Global.asax.

Could you clarify please?

Did you means if we have :

DirectMethod A
DirectMethod B

StoreLoad C

If an exeption occurs in one of this 3 (or a timeout) then, the RethroExeption will recal A, B or C loading? Automatically?

Vladimir
Jan 10, 2013, 7:37 PM
No,
By default, we catch all exceptions inside direct method and send to the client special flag (success: false)
But if you register all exception on the server side (for example, in global catcher, in Global.asax for example) then you will not see that exception in your log

If 'RethrowAjaxExceptions' is true then we throw exception again in 'catch' block, it will allow to register that exception in the global exception handler

feanor91
Jan 10, 2013, 7:48 PM
You are working late...

Is an example available somewhere, because. I am not familiar with that concept of centalising exeption.

Vladimir
Jan 10, 2013, 7:52 PM
- Please review that article and add global exception handler to your application
http://msdn.microsoft.com/en-us/library/24395wz3(v=vs.100).aspx

- Create simple test page with direct method
- Inside direct method throw an exception
- Test with 'RethrowAjaxExceptions=true' and 'RethrowAjaxExceptions=false' option of resource manager. If 'false' then you will not catch the exception in the global handler

feanor91
Jan 11, 2013, 7:55 AM
OK, I will try tht, thanks