feat: 注册异常处理器时显示名称
This commit is contained in:
parent
e646236e8d
commit
2d917d3648
|
|
@ -32,7 +32,10 @@ class AppLoader extends types_1.AppLoader {
|
||||||
regAllExceptionHandler() {
|
regAllExceptionHandler() {
|
||||||
const handlers = this.requireSth('lib/configuration/exception');
|
const handlers = this.requireSth('lib/configuration/exception');
|
||||||
if (Array.isArray(handlers)) {
|
if (Array.isArray(handlers)) {
|
||||||
handlers.forEach((handler) => this.registerInternalErrorHandler(handler));
|
handlers.forEach((handler) => {
|
||||||
|
console.log(`注册内部错误处理器: ${handler.name}`);
|
||||||
|
this.registerInternalErrorHandler(handler);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.warn('lib/configuration/exception必须默认导出一个处理器数组,当前导出类型不正确,将忽略此配置');
|
console.warn('lib/configuration/exception必须默认导出一个处理器数组,当前导出类型不正确,将忽略此配置');
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,10 @@ export class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt extends Backe
|
||||||
const handlers = this.requireSth('lib/configuration/exception') as Array<InternalErrorHandler<ED, Cxt>> | InternalErrorHandler<ED, Cxt>;
|
const handlers = this.requireSth('lib/configuration/exception') as Array<InternalErrorHandler<ED, Cxt>> | InternalErrorHandler<ED, Cxt>;
|
||||||
if (Array.isArray(handlers)) {
|
if (Array.isArray(handlers)) {
|
||||||
handlers.forEach(
|
handlers.forEach(
|
||||||
(handler) => this.registerInternalErrorHandler(handler)
|
(handler) => {
|
||||||
|
console.log(`注册内部错误处理器: ${handler.name}`);
|
||||||
|
this.registerInternalErrorHandler(handler);
|
||||||
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
console.warn('lib/configuration/exception必须默认导出一个处理器数组,当前导出类型不正确,将忽略此配置');
|
console.warn('lib/configuration/exception必须默认导出一个处理器数组,当前导出类型不正确,将忽略此配置');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue