Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    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?

    #2
    Your own error codes is a good approach.. we recommend using -5001 through -10000.

    Comment


      #3
      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. :)

      Comment

      Working...
      X