So, I am very new to Couchbase and busy using Couchbase Lite in a Xamarin (c#) mobile app.
I need some clarification to the
API documentation for the document.putProperties method.
Specifically, I want to handle failures. The docs says:
Returns an error if an error occurs while creating or saving the new Revision.
But the documentation also says that the method returns a SavedRevision object
SavedVersion newVersion = doc.PutProperties(newProperties);
if (!newVersion)
ShowErrorAlert("Couldn't update the item.");
which is clearly outdated and doesn't work. My compiler says:
The '!' operator cannot be applied to operand of type 'Couchbase.Lite.SavedRevision'
I have seen more recent examples that seem to indicate that a CouchbaseLiteException is thrown if the save was unsuccessful, but the docs doesn't mention this.
Can someone please point me to an example of how we should be detecting / handling an error.