"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.toastError = toastError;

var _reactHotToast = _interopRequireDefault(require("react-hot-toast"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function toastError(message) {
  if (message == null) {
    message = "An error occurred";
  } // eslint-disable-next-line no-console


  console.error(message);

  if (message.response && message.response.data.error) {
    _reactHotToast.default.error(message.response.data.error);
  } else {
    _reactHotToast.default.error(message);
  }
}