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

ee-error

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ee-error

Extends the native error object with a setName & setDescription method

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

ee-error

Extends the native error object with a setName & setDescription method

installation

npm install ee-error

usage

// load the module in the root of your project
require( "ee-error" );


try{
	throw new Error( "not good! you created a try catch block without any useful functionality!" ).setName( "NotGoodException" );
}
catch ( err ) {
	if ( err.name === "NotGoodException" ){
		console.log( err ); // { [NotGoodException: not good! you created a try catch block without any useful functionality!] name: 'NotGoodException' }
	}
}

if you're using the ee-log class the output of log.trace( err ) would look like this:

23 11:11:32.159 > /test.js 12:6, Object.<anonymous>             >>> [Trace]
--------------------------------------------------------------------------------
NotGoodException: not good! you created a try catch block without any useful functionality!
--------------------------------------------------------------------------------
                      /test.js   12:13  Object.<anonymous>
                     module.js  456:26  Module._compile
                     module.js  474:10  Object.Module._extensions..js
                     module.js  356:32  Module.load
                     module.js  312:12  Function.Module._load
                     module.js  497:10  Function.Module.runMain
                       node.js  119:16  startup
                       node.js  901:3   
--------------------------------------------------------------------------------

FAQs

Package last updated on 23 Aug 2013

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