serverless-spy
Version:
CDK-based library for writing elegant integration tests on AWS serverless architecture and an additional web console to monitor events in real time.
19 lines (15 loc) • 498 B
JavaScript
const c = require('colorette');
class BaseError extends Error {
constructor(message, meta, program) {
const spaces = " ".repeat(3);
const msg = spaces + c.red("Error: " + message) + "\n" + spaces +
`Type ${c.bold(program.bin() + ' --help')} for help.\n`;
super(msg);
this.name = this.constructor.name;
this.originalMessage = message;
this.meta = meta;
Error.captureStackTrace(this, this.constructor);
}
}
module.exports = BaseError;
;