4 Replies Latest reply on Jun 10, 2014 3:06 AM by Ruben Ruben

    Handle sync create-errors in javascript

    Ruben Ruben

      Hi,

       

      I've trying to figure out how to not lose data when my create has failed due to backend authentication problems. I started another thread asking how to do that, and since then I ve learned thanks to this other thread that this feature is (or was at that time) not implemented.

       

      My problem is that I don't need any complex code to guess why the create has failed or what to do about it. I just want that 'create' operations are attempted over and over again, until the user clears its local database or they are successfully completed. I've even managed to achieve this by doing a sleep(60) when I catch any exception in the source adapter, causing a timeout in the client which will force to attempt the 'create' in the next sync. But this seems a very, very dirty hack, isn't there any other way to implement this?

       

      Does anyone have a suggestion?