This repository has been archived by the owner on Nov 5, 2018. It is now read-only.
CouchDB error objects vs. Error
objects
#22
Labels
Error
objects
#22
I have struggled with this myself when using
request
directly. Often I want to do this:Unfortunately, it is better to throw a
new Error()
instead of a plain object. This provides traceback information. So I must do this:But what if there was a socket error and I already have an
Error
object? It is all a bit messy.What do you think about this (I have not tried it in code, just thinking about it now). When Couch returns an error:
new Error
with perhaps a helpful description of what went wrong (e.g. "Failed to create document")This way, the user has a choice:
Would that work or is there a problem with the idea? Thanks!
The text was updated successfully, but these errors were encountered: