john-goldsmith/vscode-aws-cloudformation-auto-template-generator

View on GitHub
src/errors/base.ts

Summary

Maintainability
A
2 hrs
Test Coverage
A
100%
/**
 * The class that all other errors should inherit from.
 *
 * @param {string} [message]
 */
export default class BaseError extends Error {

  constructor(message = 'An unknown error occurred') {
    super(message)
    if (Error.captureStackTrace) {
      Error.captureStackTrace(this, BaseError)
    }
    // this.date = new Date()
    // this.code = ...
    this.name = this.constructor.name
  }

}