"use strict";
/**
 * 异常模块
 * @date 2022-03
 * @author 何华东
 */
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) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValidateSignFailedError = exports.ParamDecryptFailedError = exports.ParamEmptyError = exports.ParamInvalidError = exports.ParamError = void 0;
/**
 * 参数异常
 *
 * @param message 异常信息
 * @param paramName 参数名
 */
var ParamError = /** @class */ (function (_super) {
    __extends(ParamError, _super);
    function ParamError(message, paramName) {
        var _this = _super.call(this) || this;
        _this.name = _this.constructor.name;
        _this.message = message;
        _this.paramName = paramName;
        return _this;
    }
    return ParamError;
}(Error));
exports.ParamError = ParamError;
/**
 * 参数无效异常
 *
 * @param paramName 参数名
 */
var ParamInvalidError = /** @class */ (function (_super) {
    __extends(ParamInvalidError, _super);
    function ParamInvalidError(paramName) {
        var _this = _super.call(this, "invalid " + paramName + ".", paramName) || this;
        _this.name = _this.constructor.name;
        return _this;
    }
    return ParamInvalidError;
}(ParamError));
exports.ParamInvalidError = ParamInvalidError;
/**
 * 参数为空异常
 *
 * @param paramName 参数名
 */
var ParamEmptyError = /** @class */ (function (_super) {
    __extends(ParamEmptyError, _super);
    function ParamEmptyError(paramName) {
        var _this = _super.call(this, (paramName || 'param') + " is empty.", paramName) || this;
        _this.name = _this.constructor.name;
        return _this;
    }
    return ParamEmptyError;
}(ParamError));
exports.ParamEmptyError = ParamEmptyError;
/**
 * 参数解密失败异常
 *
 * @param paramName 参数名
 */
var ParamDecryptFailedError = /** @class */ (function (_super) {
    __extends(ParamDecryptFailedError, _super);
    function ParamDecryptFailedError(paramName) {
        var _this = _super.call(this, (paramName || 'param') + " decrypt failed.", paramName) || this;
        _this.name = _this.constructor.name;
        return _this;
    }
    return ParamDecryptFailedError;
}(ParamError));
exports.ParamDecryptFailedError = ParamDecryptFailedError;
/**
 * 验签失败异常
 */
var ValidateSignFailedError = /** @class */ (function (_super) {
    __extends(ValidateSignFailedError, _super);
    function ValidateSignFailedError() {
        var _this = _super.call(this, 'validate sign failed.') || this;
        _this.name = _this.constructor.name;
        return _this;
    }
    return ValidateSignFailedError;
}(Error));
exports.ValidateSignFailedError = ValidateSignFailedError;
//# sourceMappingURL=Errors.js.map