1.0.1 • Published 7 years ago

@splash-cli/splash-error v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

splash-error

Handle errors

Install

	$ npm install @splash-cli/splash-error --save

	#or

	$ yarn add @splash-cli/splash-error

Usage

	import splashError from 'splash-error';

	// ... function
	try {
		const obj = JSON.parse(`{ \"json\": \"true\" }`)
	} catch (error) {
		splashError(error);
	}

Api

splashError(err, { message, colors })

Throw the given error.

err

Type: Error Error to be thrown

message

Type: String Default: Splash Error Error message

colors

Type: Object Default: { message: 'yellow', error: 'red' } Text colors

License

MIT © Federico Vitale