Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-544

ExecuteAppend and ExecutePrepend methods on .Net documentation has error in sample code

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None
    • None
    • docs
    • None
    • TP Sprint 16

    Description

      The code samples below has an error:
      http://docs.couchbase.com/couchbase-sdk-net-1.3/index.html

      client.ExecuteStore(StoreMode.Set, "beers", "Abbey Ale");
      Func<string, byte[]> stringToBytes = (s) => Encoding.Default.GetBytes(s);
      var result = client.ExecuteAppend("beers", new ArraySegment<byte>(stringToBytes(",Three Philosophers")));

      if (! result.Sucecss)
      {
      Console.WriteLine("Append failed with message

      {0} and status code {1}", result.Message, result.StatusCode);

      if (result.Exception == null)
      { throw result.Exception; }
      }



      client.ExecuteStore(StoreMode.Set, "beers", "Abbey Ale");
      Func<string, byte[]> stringToBytes = (s) => Encoding.Default.GetBytes(s);
      var result = client.ExecutePrepend("beers", new ArraySegment<byte>(stringToBytes(",Three Philosophers")));

      if (! result.Sucecss)
      {
      Console.WriteLine("Prepend failed with message {0}

      and status code

      {1}

      ", result.Message, result.StatusCode);

      if (result.Exception == null)

      { throw result.Exception; }

      }

      the last IF should be:
      if (result.Exception != null)

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            akurtzman Amy Kurtzman (Inactive)
            cihan Cihan Biyikoglu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty