Error module for LevelUP
const levelup = require('levelup')
const errors = levelup.errors
levelup('./db', { createIfMissing: false }, function (err, db) {
if (err instanceof errors.OpenError) {
console.log('open failed because expected db to exist')
}
})Generic error base class.
Error initializing the database, like when the database's location argument is missing.
Error opening the database.
Error reading from the database.
Error writing to the database.
Data not found error.
Has extra properties:
notFound:truestatus: 404
Error encoding data.
Copyright (c) 2012-2017 LevelUP contributors.
LevelUP is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.
