Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Unrecoverable error handling not behaving as expected

$
0
0
Version: v9.0_2013-07-03/LGPL Development Only
Browsers: Chrome, Firefox

Based on this snippet from http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/data/RestDataSource.html:

"An unrecoverable error, such as an unexpected server failure, can be flagged by setting <status> to -1 and setting <data> to an error message. In this case the <errors> element is not used (it's specific to validation errors). An unrecoverable error causes all response processing to be skipped and RPCManager.handleError() to be invoked, which by default will show the provided error message as an alert using isc.warn()."

I've set up my error response from the server in the form of:

{
"response" :{
"status" : -1,
"data" : "This is an error"
}
}

However, the client side behaviour is not as advertised. Rather than going into RPCManager.handleError(), it calls the callback method instead and a breakpoint at this time reveals that the status changes to '0' for some reason. And yes, in case you're going to ask, I've already set willHandleError to false.

Additionally, if I set data to null rather than the error string, the -1 status is maintained and RPCManager.handleError() is called.

Have I misunderstood the document? What is the proper response structure for unrecoverable errors?

Viewing all articles
Browse latest Browse all 4756

Trending Articles