"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.showDefaultErrorMessage = exports.showErrorMessage = void 0;
var ui_i18n_1 = __importDefault(require("ui-i18n"));
var mdm_sdk_1 = require("@reltio/mdm-sdk");
var ErrorPopup_1 = require("../ErrorPopup");
var showErrorMessage = function (error, params) {
    var _a = params || {}, _b = _a.title, title = _b === void 0 ? ui_i18n_1.default.text('Error') : _b, message = _a.message, defaultMessage = _a.defaultMessage;
    console.warn(error);
    ErrorPopup_1.ErrorPopup.addError({
        title: title,
        message: message || (0, mdm_sdk_1.getRequestErrorMessage)(error, defaultMessage)
    });
};
exports.showErrorMessage = showErrorMessage;
var showDefaultErrorMessage = function (error) {
    (0, exports.showErrorMessage)(error, { defaultMessage: ui_i18n_1.default.text('Something went wrong') });
};
exports.showDefaultErrorMessage = showDefaultErrorMessage;
