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

Does not return errors object on view operation

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Fixed
    • Blocker
    • 1.3.1
    • 1.2.7
    • library

    Description

      The couchbase maunal shows the JSON for view responses:
      http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views-writing-querying-errorcontrol.html

      The Java and python SDK have ability to access errors .net does not.

      Looking at CouchbaseViewHandler. It looks like its meant to be throwing an exception when it gets errors in the JSON. However that exception will never happen as there is a bug on lines 95 to 101 (code below). The two if statements counter each other. You can fix it via calling jsonReader.Read() after the 1st if statement however I believe that is not the correct solution. We should return an error object. I think the whole IEnumerator<T> TransformResults<T>(Func<JsonReader, T> rowTransformer, IDictionary<string, string> viewParams) needs looking at.

      if (jsonReader.TokenType == JsonToken.PropertyName
      && jsonReader.Depth == 1
      && ((string)jsonReader.Value) == "errors")
      {
      // we skip the deserialization if the array is null
      if (jsonReader.TokenType == Newtonsoft.Json.JsonToken.StartArray)
      {

      Attachments

        Activity

          People

            jmorris Jeff Morris
            pvarley Patrick Varley (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty