Very good question!

There was an API change when we switched the Xamarin component from the old iOS 
binding to the C# implementation. When I updated the Xamarin component’s 
getting started guide, I missed that line.

It’s fixed in our repository[1], and will be updated in our next release.

The line should be: `if (newVersion == null)`.

Thanks for bringing this to our attention.

Regards,
Zack

[1] 
https://github.com/couchbase/couchbase-lite-net/commit/9a1a876620ae6bf1574756903c24ed68a84c1ccd#diff-7aea853f6733904ab545592cc498ae9c

On Dec 3, 2014, at 6:02 AM, Jannie Theunissen 
<[email protected]<mailto:[email protected]>> wrote:

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]<mailto:[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<https://groups.google.com/d/msgid/mobile-couchbase/bc8aad81-ac9e-4cb7-b1ab-bbc6c71eb758%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
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/7990B931-A201-4A62-95C9-1D8C2CDE950B%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to