import { useSnackbarStore } from '@/store/SnackbarStore';

export class BaseError {
  data;//could be validation errors or any meta data of errors
  message ="Unexpected Failure Please Check Your Internet Connection.";//the previewed message for user

  initData(error, data) {
    this.error = error;
    this.data = data;
    return this;
  }
  dispatchError() {
    useSnackbarStore().showSnackbar(`${this.message}`, { color: 'error' })
  }
}
