j3k0 opened a new pull request #248:
URL: https://github.com/apache/couchdb-nano/pull/248


   ## Overview
   
   Errors triggered by nano are extended with additional fields, this commits 
adds the typescript definition for them.
   
   The name "RequestError" was chosen because it seems like it all nano errors 
are triggered by a request (a 'socket' or a 'couch' error).
   
   I considered "NanoError", but the full type `nano.NanoError` doesn't sound 
better than `nano.RequestError` and no other interface have been prefixed with 
"Nano".
   
   I've extracted the error fields from `nano.js`.
   
   ## Testing recommendations
   
   There's no typescript tests so far, I included this change in my typescript 
project.
   
   This change can affect users if they uses nano with callbacks incorrectly, 
their project could fail building.
   
   Errors are simple to fix. For example, on my project there was an instance 
where I used `error.status` instead of `error.statusCode`. Another issue is 
that I passed a callback that expected `Error | undefined` for the error field 
while nano sends `Error | null`.
   
   ## Checklist
   
   - [ ] Code is written and works correctly;
   - [ ] Changes are covered by tests;
   - [ ] Documentation reflects the changes;
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to