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 
<http://developer.couchbase.com/mobile/develop/references/couchbase-lite/couchbase-lite/document/document/index.html#savedrevision-putpropertiesmapstring-object-properties>
.
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

In a the Xamarin docs 
<http://components.xamarin.com/gettingstarted/couchbase-lite-net> they have 
this example :

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. 

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/bc8aad81-ac9e-4cb7-b1ab-bbc6c71eb758%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to