Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.
/ errors Public archive

Latest commit

 

History

History
69 lines (40 loc) · 1.54 KB

File metadata and controls

69 lines (40 loc) · 1.54 KB

level-errors

LevelDB Logo

Error module for LevelUP

Build Status JavaScript Style Guide Greenkeeper badge

Usage

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')
  }
})

API

.LevelUPError()

Generic error base class.

.InitializationError()

Error initializing the database, like when the database's location argument is missing.

.OpenError()

Error opening the database.

.ReadError()

Error reading from the database.

.WriteError()

Error writing to the database.

.NotFoundError()

Data not found error.

Has extra properties:

  • notFound: true
  • status: 404

.EncodingError()

Error encoding data.

Publishers

License & copyright

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.