Socket
Socket
Sign inDemoInstall

@oclif/errors

Package Overview
Dependencies
16
Maintainers
7
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @oclif/errors

display friendly CLI errors and log to error log


Version published
Weekly downloads
1.3M
decreased by-0.41%
Maintainers
7
Install size
336 kB
Created
Weekly downloads
 

Package description

What is @oclif/errors?

The @oclif/errors npm package is designed to handle errors within the oclif (Open CLI Framework) ecosystem. It provides a structured way to create and manage errors in command-line applications built with oclif. The package allows developers to define custom error types, handle errors gracefully, and display user-friendly error messages.

What are @oclif/errors's main functionalities?

CLIError

CLIError is a custom error type provided by @oclif/errors for general command-line interface errors. It can be used to throw errors with a message that will be displayed to the user.

const { CLIError } = require('@oclif/errors');

throw new CLIError('Something went wrong!');

ExitError

ExitError is a custom error type that can be used to exit the process with a specific exit code. This is useful for signaling to the shell or parent process that the command failed with a particular error state.

const { ExitError } = require('@oclif/errors');

throw new ExitError(1);

handle

The handle function is used to catch and handle errors gracefully within an oclif application. It can be used to intercept uncaught exceptions and display a user-friendly message or perform cleanup before exiting.

const { handle } = require('@oclif/errors');

process.on('uncaughtException', error => {
  handle(error);
});

Other packages similar to @oclif/errors

Readme

Source

@oclif/errors

This library has been replaced by @oclif/core and is now in maintenance mode. We will only consider PRs that address security concerns.

display friendly CLI errors and log to error log

Version CircleCI Appveyor CI Known Vulnerabilities Downloads/week License

Keywords

FAQs

Last updated on 27 Sep 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc