"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const exception_1 = require("@gem-mine/exception");
const config_1 = require("../config");
const env_1 = require("../config/constant/env");
const logger_1 = require("../util/logger");
// 异常处理中间件
// 更多配置请查看：https://github.com/gem-mine/exception
exports.default = exception_1.default({
    debug: config_1.default.ENV === env_1.default.local,
    // 将异常写入日志
    logger(data, ctx) {
        logger_1.error.error(data.message, {
            detail: data,
            requestId: ctx.id
        });
    },
    notFoundPage: '404.html'
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhjZXB0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL21pZGRsZXdhcmUvZXhjZXB0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsbURBQTJDO0FBQzNDLHNDQUE4QjtBQUM5QixnREFBd0M7QUFDeEMsMkNBQWdEO0FBRWhELFVBQVU7QUFDVixnREFBZ0Q7QUFDaEQsa0JBQWUsbUJBQVMsQ0FBQztJQUN2QixLQUFLLEVBQUUsZ0JBQU0sQ0FBQyxHQUFHLEtBQUssYUFBRyxDQUFDLEtBQUs7SUFDL0IsVUFBVTtJQUNWLE1BQU0sQ0FBQyxJQUFJLEVBQUUsR0FBRztRQUNkLGNBQU0sQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLE9BQU8sRUFBRTtZQUN6QixNQUFNLEVBQUUsSUFBSTtZQUNaLFNBQVMsRUFBRSxHQUFHLENBQUMsRUFBRTtTQUNsQixDQUFDLENBQUE7SUFDSixDQUFDO0lBQ0QsWUFBWSxFQUFFLFVBQVU7Q0FDekIsQ0FBQyxDQUFBIn0=