import * as ERROR_CODES from '../constants/error-code'

type LicenseErrorArgument = {
  errorCode: string
  detail?: Object
}
export class LicenseError extends Error {
  static get ERROR_CODES(): any {
    return {
      ...ERROR_CODES
    }
  }
  errorCode: any
  detail: Object
  constructor({ errorCode, detail }: LicenseErrorArgument) {
    super(errorCode)
    this.name = 'license-error'
    this.errorCode = errorCode
    this.detail = detail
  }
}
