Hi
I have an app where the user can register and login. If they have done that then we use their credentials to start the replicator (to get the user specific documents via their channel).
But if the user has either entered a wrong password - or changed it via a browser interface to the same system - then how do I catch this error in the replicator?
I have this code just before I start the replicator:
replListener = this.replicator.AddChangeListener((sender, args) =>
{
var s = args.Status;
Logger.Debug($"{replType} Replicator: {s.Progress.Completed}/{s.Progress.Total}, error {s.Error?.Message ?? "<none>"}, activity = {s.Activity}");
});
When providing a wrong login then I get (as expected) something like this:
[DbDataStore] Pull Replicator: 0/0, error CouchbaseLiteException (WebSocketDomain / 401): CouchbaseLiteException (WebSocketDomain / 401): (unknown HTTP status).., activity = Busy
[DbDataStore] Pull Replicator: 0/0, error CouchbaseLiteException (WebSocketDomain / 401): CouchbaseLiteException (WebSocketDomain / 401): (unknown HTTP status).., activity = Stopped
I have tried to “get my hands on” this exception? The s.Error
property does not provide me with the web socket information (specifically the 401 error code). I have tried to look in the API documentation and search for examples - but haven’t really found anything that I could use… - and I have not been able to set a breakpoint and stop the code in the event handler…
I would appreciate a little insight on this
I’m on Sync Gateway 2.5.1 and CB Lite 2.5.3 (C#)