export default class ServiceException extends Error {
  message: string;
  code: number | undefined;
  constructor (message: string, code?: number) {
    super()
    this.message = message;
    this.code = code;
  }

  public getMessage() : string {
    return this.message;
  }

  public setMessage(message: string) : ServiceException {
    this.message = message;
    return this
  }

  public getCode() : number | undefined {
    return this.code;
  }
}
