Colored-Coins / Colored-Coins-Block-Explorer

An implementation of a full Bitcoin Block Explorer (Parser/API/Sockets) with full Colored-Coins capabilities
17 stars 30 forks source link

Error Management #5

Closed oleiba closed 8 years ago

oleiba commented 8 years ago
tal-beja commented 8 years ago

What about errors that returned from the db?

collection.find(..., function(err, doc) {
 if (err) return callback(err) <---?
})
oleiba commented 8 years ago

The new error handler middleware cc-error-handler treats errors which are merely instances of Error, and not ColoredCoinsError, as third party errors - and encapsulates them with the original field in the returned error object if the configured env is development. Otherwise it will not include it at all.