@mongosh/errors
MongoDB Shell Errors Package
Last updated 2 months ago by addaleax .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @mongosh/errors 
SYNC missed versions from official npm registry.

@mongosh/errors

Package for MongoDB Shell

Usage

const { MongoshUnimplementedError } = require('@mongosh/errors');

function evaluate(input) {
  if (input === 'some input') {
    throw new MongoshUnimplementedError(`${input} is not implemented`);
  }
}

// throws: MongoshUnimplemetedError: some input is not implemented
evaluate('some input')

API

MongoshWarning(msg)

This error is used to give user a warning about the current execution. args:

  • msg: type string. Describes the warning.

MongoshUnimplementedError(msg)

This error is used to API endpoints that are not yet implemented. args:

  • msg: type string. Describes what is not yet implemented.

MongoshRuntimeError(msg)

Used for errors in evaluation, specific to MongoDB Shell. Should not be used for JavaScript runtime errors.

args:

  • msg: type string. Describes what caused the error and a potential fix, if avaialable.

MongoshInternalError(msg)

Used for rare cases when MongoDB Shell is not able to parse and evaluate the input. args:

  • msg: type string. Describes error in detail, so the user can better report it.

e.message will be appended with the following information:

This is an error inside Mongosh. Please file a bug report. Please include a log file from this session.

MongoshInvalidInputError(msg)

This error is used for invalid MongoDB input. This should not be used for JavaScript syntax errors, but rather for those specific to MongoDB. args:

  • msg: type string. Describes error in detail, providing current invalid input, and a fix, if available.

Installation

npm install -S @mongosh/errors

Current Tags

  • 0.6.1                                ...           latest (2 months ago)

28 Versions

  • 0.6.1                                ...           2 months ago
  • 0.6.0                                ...           2 months ago
  • 0.5.2                                ...           2 months ago
  • 0.5.1                                ...           2 months ago
  • 0.5.0                                ...           3 months ago
  • 0.4.2                                ...           4 months ago
  • 0.4.1                                ...           4 months ago
  • 0.4.0                                ...           4 months ago
  • 0.3.1                                ...           4 months ago
  • 0.3.0                                ...           4 months ago
  • 0.2.2                                ...           5 months ago
  • 0.2.1                                ...           5 months ago
  • 0.2.0                                ...           5 months ago
  • 0.1.0                                ...           6 months ago
  • 0.0.8                                ...           6 months ago
  • 0.0.7                                ...           7 months ago
  • 0.0.6                                ...           7 months ago
  • 0.0.5                                ...           8 months ago
  • 0.0.4                                ...           8 months ago
  • 0.0.3                                ...           8 months ago
  • 0.0.2-alpha.0                                ...           8 months ago
  • 0.0.1                                ...           8 months ago
  • 0.0.1-alpha.19                                ...           8 months ago
  • 0.0.1-alpha.18                                ...           8 months ago
  • 0.0.1-alpha.17                                ...           8 months ago
  • 0.0.1-alpha.15                                ...           8 months ago
  • 0.0.1-alpha.14                                ...           8 months ago
  • 0.0.1-alpha.13                                ...           9 months ago

Copyright 2014 - 2017 © taobao.org |