"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.HumanError = void 0;
var core_1 = __importDefault(require("../utils/core"));
var common_1 = require("../utils/common");
var colors = core_1.default.colors, report = core_1.default.report;
var HumanError = /** @class */ (function (_super) {
    __extends(HumanError, _super);
    function HumanError(errorMessage, tips, error) {
        var _this = _super.call(this) || this;
        console.log("\n" + (0, common_1.bgRed)('ERROR:'));
        console.log(errorMessage + " " + colors.gray(tips) + "\n");
        report({
            type: 'jsError',
            content: errorMessage + ", " + error.stack,
        }).then(function () { return process.exit(1); });
        return _this;
    }
    return HumanError;
}(Error));
exports.HumanError = HumanError;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHVtYW4tZXJyb3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZXJyb3IvaHVtYW4tZXJyb3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsdURBQWlDO0FBQ2pDLDBDQUF3QztBQUVoQyxJQUFBLE1BQU0sR0FBYSxjQUFJLE9BQWpCLEVBQUUsTUFBTSxHQUFLLGNBQUksT0FBVCxDQUFVO0FBQ2hDO0lBQWdDLDhCQUFLO0lBQ25DLG9CQUFZLFlBQW9CLEVBQUUsSUFBWSxFQUFFLEtBQVk7UUFBNUQsWUFDRSxpQkFBTyxTQU9SO1FBTkMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxPQUFLLElBQUEsY0FBSyxFQUFDLFFBQVEsQ0FBRyxDQUFDLENBQUM7UUFDcEMsT0FBTyxDQUFDLEdBQUcsQ0FBSSxZQUFZLFNBQUksTUFBTSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBSSxDQUFDLENBQUM7UUFDdEQsTUFBTSxDQUFDO1lBQ0wsSUFBSSxFQUFFLFNBQVM7WUFDZixPQUFPLEVBQUssWUFBWSxVQUFLLEtBQUssQ0FBQyxLQUFPO1NBQzNDLENBQUMsQ0FBQyxJQUFJLENBQUMsY0FBTSxPQUFBLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLEVBQWYsQ0FBZSxDQUFDLENBQUM7O0lBQ2pDLENBQUM7SUFDSCxpQkFBQztBQUFELENBQUMsQUFWRCxDQUFnQyxLQUFLLEdBVXBDO0FBVlksZ0NBQVUifQ==