Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
check notFound on err
Browse files Browse the repository at this point in the history
When do a `db.get`, check for `.notFound` on `err` to determine if a `NotFoundError` should be created.
  • Loading branch information
doowb committed Jan 19, 2015
1 parent ef28adb commit 8b339de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/levelup.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ LevelUP.prototype.get = function (key_, options, callback) {

this.db.get(key, options, function (err, value) {
if (err) {
if ((/notfound/i).test(err)) {
if ((/notfound/i).test(err) || err.notFound) {
err = new NotFoundError(
'Key not found in database [' + key_ + ']', err)
} else {
Expand Down

0 comments on commit 8b339de

Please sign in to comment.