Go Back   SmartClient Forums > Smart GWT Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 8th Aug 2012, 12:15
mathias mathias is offline
Registered Developer
 
Join Date: Aug 2010
Posts: 236
Default DSResponse and custom status codes

Hi, i'm looking at my applications error handling and have a question.

Right now, when a server request goes wrong for reasons specific to the logic of my application, i currently solve the communication this way:

1. i set status to STATUS_FAILURE
2. i call setData with a positive integer that has a meaning to my app so that it can react properly in the browser.


I was thinking that it perhaps was better that i set the DSResponse status to custom negative integer values instead, since it's more in line with how you do it... And that way, i can have global handling of my custom status codes in my custom RPCExceptionHandler.

However, it's hard to know from the documentation which integer range you use for your status codes

How do i figure out which integers are "safe" for me to use, or do you recommend a different approach?
Reply With Quote
  #2  
Old 8th Aug 2012, 12:39
Isomorphic Isomorphic is online now
Administrator
 
Join Date: May 2006
Posts: 30,569
Default

Your own error codes is a good approach.. we recommend using -5001 through -10000.
Reply With Quote
  #3  
Old 27th Aug 2012, 01:21
mathias mathias is offline
Registered Developer
 
Join Date: Aug 2010
Posts: 236
Default

Hey, i'm a little bit late in answering, but thanks!

Small question:
Since i didn't manage to find any docs regarding this, when you say "we recommend", is that on a javadoc page or similar somewhere that i missed?

Still trying to get my bearings regarding how to best find smartgwt documentation/information. :)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
DMI with custom operation isosmart Smart GWT Technical Q&A 10 14th May 2012 01:39
performCustomOperation and Custom Datasource jpappalardo Smart GWT Technical Q&A 5 20th Apr 2012 13:22
Callback function is not called after DSResponse status set to Failure issac.ming Smart GWT Technical Q&A 2 26th Oct 2011 04:27
Custom attributes in DSResponse. Is it possible? asg2007 Smart GWT Technical Q&A 6 4th Apr 2011 04:05
Custom REST DataSource - DSRequest data fabio.bozzo Smart GWT Technical Q&A 0 3rd Jan 2010 23:51

© 2010,2011 Isomorphic Software. All Rights Reserved