ricellis opened a new issue #58: Provide more information for socket errors
URL: https://github.com/apache/couchdb-nano/issues/58
 
 
   <!--- Provide a general summary of the issue in the Title above -->
   It would be helpful to provide additional error information in the message 
Nano outputs for socket or connection errors.
   
   ## Expected Behavior
   <!--- If you're describing a bug, tell us what should happen -->
   <!--- If you're suggesting a change/improvement, tell us how it should work 
-->
   
   Suggest including, for example, reading the error `.code` and `.description` 
and adding it to the message to provide some more useful diagnostics.
   ```js
   {
     code: 'ECONNRESET',
     description: 'socket hang up'
   }
   ```
   err.message -> `error happened in your connection ECONNRESET socket hang up`
   
   ## 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 -->
   
   Currently for a socket/connection error only the `err.message` is set to 
`error happened in your connection`.
   
   err.message -> `error happened in your connection`
   
   ## Possible Solution
   <!--- Not obligatory, but suggest a fix/reason for the bug, -->
   <!--- or ideas how to implement the addition or change -->
   
   Could build up the error message to include `.code` and `.description` if 
they are available e.g.
   ```
     if (err && err.code) {
       err.message = `${err.message} ${err.code}`;
     }
     if (err && err.description) {
       err.message = `${err.message} ${err.description}`;
     }
   ```
   
   ## 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. Could use nock `replyWithError` to reproduce e.g.
   ```js
   nock.get(...).replyWithError({'description': 'socket hang up', 'code': 
'ECONNRESET'});
   ```
   
   
   ## 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 -->
   
   Made it hard to debug some connection issues without adding additional 
output statements to see the underlying cause of the error. Similarly to #54 
where the whole error object has been output because the message `error 
happened in your connection` is insufficient to identify the issue.
   
   ## Your Environment
   <!--- Include as many relevant details about the environment you experienced 
the bug in -->
   * Version used:
   >6.4.0
   * Browser Name and version:
   >Node.js 8.2.0
   * Operating System and version (desktop or mobile):
   > macOS 10.12.6
   * Link to your project:
   >https://github.com/cloudant/nodejs-cloudant
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to