You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/02/27 01:18:10 UTC

[GitHub] [couchdb-nano] dobesv opened a new issue #203: TypeScript types for database.fetch do not allow for error responses

dobesv opened a new issue #203: TypeScript types for database.fetch do not allow for error responses
URL: https://github.com/apache/couchdb-nano/issues/203
 
 
   ## Expected Behavior
   
   When using typescript with the library, and I use the `fetch` method to get multiple documents by id, I should be able to check for an `error` in the returned rows.  
   
   ## Current Behavior
   
   <!--- If describing a bug, tell us what happens instead of the expected behavior -->
   <!--- If suggesting a change/improvement, explain the difference from current behavior -->
   
   ## Possible Solution
   <!--- Not obligatory, but suggest a fix/reason for the bug, -->
   <!--- or ideas how to implement the addition or change -->
   
   ## Steps to Reproduce (for bugs)
   <!--- Provide a link to a live example, or an unambiguous set of steps to -->
   <!--- reproduce this bug. Include code to reproduce, if relevant -->
   1.
   2.
   3.
   4.
   
   ## Context
   <!--- How has this issue affected you? What are you trying to accomplish? -->
   <!--- Providing context helps us come up with a solution that is most useful in the real world -->
   
   ## Your Environment
   <!--- Include as many relevant details about the environment you experienced the bug in -->
   * Version used:
   * Browser Name and version:
   * Operating System and version (desktop or mobile):
   * Link to your project:
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb-nano] dobesv commented on issue #203: TypeScript types for database.fetch do not allow for error responses

Posted by GitBox <gi...@apache.org>.
dobesv commented on issue #203: TypeScript types for database.fetch do not allow for error responses
URL: https://github.com/apache/couchdb-nano/issues/203#issuecomment-591734530
 
 
   Patch:
   
   ```
   diff --git a/node_modules/nano/lib/nano.d.ts b/node_modules/nano/lib/nano.d.ts
   index 4175bb1..7351032 100644
   --- a/node_modules/nano/lib/nano.d.ts
   +++ b/node_modules/nano/lib/nano.d.ts
   @@ -749,6 +749,11 @@ declare namespace nano {
      // Document scope request and response
      // -------------------------------------
    
   +  interface DocumentLookupFailure {
   +    key: string;
   +    error: string;
   +  }
   +
      interface DocumentResponseRowMeta {
        id: string;
        key: string;
   @@ -976,14 +981,14 @@ declare namespace nano {
    
      interface DocumentFetchResponse<D> {
        offset: number;
   -    rows: Array<DocumentResponseRow<D>>;
   +    rows: Array<DocumentResponseRow<D> | DocumentLookupFailure>;
        total_rows: number;
        update_seq?: number;
      }
    
      interface DocumentFetchRevsResponse {
        offset: number;
   -    rows: DocumentResponseRowMeta[];
   +    rows: Array<DocumentResponseRowMeta | DocumentLookupFailure>;
        total_rows: number;
        update_seq?: number;
      }
   
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb-nano] glynnbird closed issue #203: TypeScript types for database.fetch do not allow for error responses

Posted by GitBox <gi...@apache.org>.
glynnbird closed issue #203: TypeScript types for database.fetch do not allow for error responses
URL: https://github.com/apache/couchdb-nano/issues/203
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services