Skip to content
This repository was archived by the owner on Sep 9, 2021. It is now read-only.

Feat/err codes #22

Merged
merged 3 commits into from
Sep 17, 2018
Merged

Feat/err codes #22

merged 3 commits into from
Sep 17, 2018

Conversation

jacobheun
Copy link
Contributor

I also updated the dependencies to their latest versions.

I have also run the updated tests locally against the error implementation in datastore-fs for reference. https://github.com/ipfs/js-datastore-fs/compare/feat/err-codes?expand=1 (note: the ci tests will fail there until the dependency is updated)

@ghost ghost assigned jacobheun Sep 11, 2018
@ghost ghost added the status/in-progress In progress label Sep 11, 2018
@jacobheun jacobheun requested review from pgte and alanshaw September 11, 2018 21:18
License: MIT
Signed-off-by: Jacob Heun <jacobheun@gmail.com>
Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

src/errors.js Outdated
module.exports.ERR_DB_CANNOT_OPEN = (err) => {
err = err || new Error('Cannot open database')
return errcode(err, 'ERR_CANNOT_OPEN_DB')
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERR_DB_OPEN_FAILED for consistency with the others?

src/errors.js Outdated
module.exports.ERR_NOT_FOUND = (err) => {
err = err || new Error('Not Found')
return errcode(err, 'ERR_NOT_FOUND')
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better for these factory functions to be named more like dbDeleteError(), notFoundError()? All caps var names are by popular convention constant values and not functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the function names and the open failure code

License: MIT
Signed-off-by: Jacob Heun <jacobheun@gmail.com>
@jacobheun
Copy link
Contributor Author

jacobheun commented Sep 12, 2018

@dignifiedquire it looks like you and @diasdavid are the only ones with publish permissions to npm for this repo. With him out until Friday would you be able to do a release of this so we can get js-ipfs#1557 resolved?

@daviddias daviddias merged commit 78333bb into master Sep 17, 2018
@daviddias daviddias deleted the feat/err-codes branch September 17, 2018 22:24
@ghost ghost removed the status/in-progress In progress label Sep 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants