import { ApplicationContext, Catch, IMidwayContainer, Inject } from '@midwayjs/core';
import { Context } from '@midwayjs/koa';

// 非自定义异常
@Catch()
export class DefaultErrorFilter {
  @Inject()
  ctx: Context;
  @ApplicationContext()
  applicationContext: IMidwayContainer;
  async catch(err: Error, ctx: Context) {
    console.error(err);
    // 接收并处理系统定义错误
    throw err;
  }
}
