How to get errors or status code of sync process

18 views
Skip to first unread message

Ami Kapadia

unread,
Dec 16, 2014, 10:35:23 AM12/16/14
to mobile-c...@googlegroups.com
Hi!

I am using CBLite with COAX, HOAX library in my PhoneGap app using this - https://github.com/couchbaselabs/TodoLite-PhoneGap/blob/master/js/index.js. Currently  CoouchDB server database configuration is changed (It was related to authentication) and CBLite sync process stopped working because of this. Here CBLite plugin is initialised properly. But data synchronisation is not working at all.
I want to handle errors properly for this kind of scenario. So that whenever we get any bug or improper status from CBLIte sync process, we can console/notify error to user and developers. 
Do you have any idea from where I can get proper error or status codes of sync process here - https://github.com/couchbaselabs/TodoLite-PhoneGap/blob/master/js/index.js

Thanks!
Ami

Jens Alfke

unread,
Dec 16, 2014, 12:35:58 PM12/16/14
to mobile-c...@googlegroups.com

> On Dec 16, 2014, at 7:35 AM, Ami Kapadia <ami....@gmail.com> wrote:
>
> Do you have any idea from where I can get proper error or status codes of sync process here - https://github.com/couchbaselabs/TodoLite-PhoneGap/blob/master/js/index.js

I don't know the JS library, but at the REST API level you do this by doing a GET of /_active_tasks and looking for the task entry corresponding to your replication. It will have a property describing the current status and any error.

(If you search the group archive for '_active_tasks' you'll find some threads talking about the best way to do this.)

—Jens
Reply all
Reply to author
Forward
0 new messages