"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ServerlessError = void 0;
var i18n_1 = __importDefault(require("i18n"));
var core_1 = require("@serverless-devs/core");
var ServerlessError = /** @class */ (function () {
    function ServerlessError(phase, message, params) {
        i18n_1.default.configure({
            logDebugFn: function (msg) { },
            logWarnFn: function (msg) { },
            logErrorFn: function (msg) { },
            locales: ['en', 'zh'],
            register: global
        });
        this.logger.error(i18n_1.default.__(phase) + ': ' + i18n_1.default.__(message, params));
        process.exit(-1);
    }
    __decorate([
        core_1.HLogger('S-CLI-ERROR'),
        __metadata("design:type", Object)
    ], ServerlessError.prototype, "logger", void 0);
    return ServerlessError;
}());
exports.ServerlessError = ServerlessError;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmVybGVzcy1lcnJvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9lcnJvci9zZXJ2ZXJsZXNzLWVycm9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7OztBQUNBLDhDQUF3QjtBQUN4Qiw4Q0FBeUQ7QUFFekQ7SUFFRSx5QkFBWSxLQUFhLEVBQUUsT0FBZSxFQUFFLE1BQVk7UUFDdEQsY0FBSSxDQUFDLFNBQVMsQ0FBQztZQUNiLFVBQVUsRUFBRSxVQUFVLEdBQUcsSUFBSSxDQUFDO1lBQzlCLFNBQVMsRUFBRSxVQUFVLEdBQUcsSUFBSSxDQUFDO1lBQzdCLFVBQVUsRUFBRSxVQUFVLEdBQUcsSUFBSSxDQUFDO1lBQzlCLE9BQU8sRUFBRSxDQUFDLElBQUksRUFBRSxJQUFJLENBQUM7WUFDckIsUUFBUSxFQUFFLE1BQU07U0FDakIsQ0FBQyxDQUFDO1FBQ0gsSUFBSSxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsY0FBSSxDQUFDLEVBQUUsQ0FBQyxLQUFLLENBQUMsR0FBRyxJQUFJLEdBQUcsY0FBSSxDQUFDLEVBQUUsQ0FBQyxPQUFPLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQztRQUNwRSxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDbkIsQ0FBQztJQVh1QjtRQUF2QixjQUFPLENBQUMsYUFBYSxDQUFDOzttREFBaUI7SUFZMUMsc0JBQUM7Q0FBQSxBQWJELElBYUM7QUFiWSwwQ0FBZSJ9