Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mongosh/errors

Package Overview
Dependencies
Maintainers
8
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mongosh/errors

MongoDB Shell Errors Package

  • 0.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
decreased by-31.56%
Maintainers
8
Weekly downloads
 
Created
Source

@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

FAQs

Package last updated on 17 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc