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

@mongosh/errors

Package Overview
Dependencies
Maintainers
7
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.1-alpha.13
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16K
increased by7.21%
Maintainers
7
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

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 29 Apr 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