Skip to Content
author's profile photo Former Member
Former Member

OData submitChanges() Error Handling

Hello,

I'm using OData Model with TwoWay binding and after I change something I call the method submitChanges().

I'm expecting an error because of the eTag verification.

The problem is that the error occur but the callback function is always success.

If you open the OData object, you will see the expected error response 412, but it is considered success in general.

I want to show a MessageBox when this error occurs, but the response is always success even with this error.

Hou can I proceed?

Thanks in advance,

Henrique Schorr

OData response.jpg (74.1 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jun 28, 2016 at 12:19 PM

    Hi Henrique,

    I have the exact same problem. Did you solve this issue in meantime? My submitChanges always result in executing the 'success' callback function.

    Kind Regards,

    Nico van der Linden

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Henrique,

      Thanks for your reply, in meantime I indeed did something similar. And it seems to work for me as well.

      I get a __batchResponses array back through the 'success' call back function of submitChanges which always contains two entries. __batchResonses[0] contains the error (if there was an error) and __batchResponses[1] is always correct.

      Did you have the same finding? I started with a for loop as well but since I noticed that the error response is always in the first array item I just looked directly for an undefined or response Higher then 299 to be sure that an error occurred.

      Regards,

      Nico

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.