"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpExitError = exports.ValidationError = exports.BizError = exports.BizErrorEnum = void 0;
const core_1 = require("@midwayjs/core");
exports.BizErrorEnum = (0, core_1.registerErrorCode)('biz', {
    UNKNOWN: 10000,
});
/**
 * 业务异常
 */
class BizError extends core_1.MidwayError {
    constructor(message, code = exports.BizErrorEnum.UNKNOWN) {
        super(message !== null && message !== void 0 ? message : '业务异常', typeof code === 'number' ? String(code) : code);
    }
}
exports.BizError = BizError;
/**
 * 校验异常
 */
class ValidationError extends Error {
    constructor(message) {
        super(message);
    }
}
exports.ValidationError = ValidationError;
/**
 * 校验异常
 */
class HttpExitError extends Error {
    constructor(httpStatus, message, data) {
        super(message);
        this.httpStatus = httpStatus;
        this.data = data;
    }
}
exports.HttpExitError = HttpExitError;
//# sourceMappingURL=index.js.map