{"record":{"id":"9838680a7290a512","repo":"nestjs/nest","slug":"metatype-name-is-decorated-with-catch-and","errorCode":null,"errorMessage":"\"${metatype.name}\" is decorated with @Catch() and cannot appear in the \"imports\" array of a module. Please move \"${metatype.name}\" to the \"providers\" array (using the APP_FILTER token to apply it globally) or apply it via @UseFilters() instead.\n\nScope [${scope}]\n","messagePattern":"\"(.+?)\" is decorated with @Catch\\(\\) and cannot appear in the \"imports\" array of a module\\. Please move \"(.+?)\" to the \"providers\" array \\(using the APP_FILTER token to apply it globally\\) or apply it via @UseFilters\\(\\) instead\\.\n\nScope \\[(.+?)\\]\n","errorType":"exception","errorClass":"InvalidClassModuleException","httpStatus":null,"severity":"error","filePath":"packages/core/scanner.ts","lineNumber":213,"sourceCode":"      ? moduleDefinition.forwardRef()\n      : moduleDefinition;\n\n    if (this.isInjectable(moduleToAdd)) {\n      throw new InvalidClassModuleException(\n        moduleDefinition,\n        scope,\n        'provider',\n      );\n    }\n    if (this.isController(moduleToAdd)) {\n      throw new InvalidClassModuleException(\n        moduleDefinition,\n        scope,\n        'controller',\n      );\n    }\n    if (this.isExceptionFilter(moduleToAdd)) {\n      throw new InvalidClassModuleException(moduleDefinition, scope, 'filter');\n    }\n\n    return this.container.addModule(moduleToAdd, scope);\n  }\n\n  public async scanModulesForDependencies(\n    modules: Map<string, Module> = this.container.getModules(),\n  ) {\n    for (const [token, { metatype }] of modules) {\n      await this.reflectImports(metatype, token, metatype.name);\n      this.reflectProviders(metatype, token);\n      this.reflectControllers(metatype, token);\n      this.reflectExports(metatype, token);\n    }\n  }\n\n  public async reflectImports(\n    module: Type<unknown>,","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/nestjs/nest/blob/dd75d7bd8c5e88048587e6768d36eb695f3e7a25/packages/core/scanner.ts#L195-L231","documentation":"Error \"\"${metatype.name}\" is decorated with @Catch() and cannot appear in the \"imports\" array of a module. Please move \"${metatype.name}\" to the \"providers\" array (using the APP_FILTER token to apply it globally) or apply it via @UseFilters() instead.\n\nScope [${scope}]\n\" thrown in nestjs/nest.","triggerScenarios":"Thrown at packages/core/scanner.ts:213 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"dd75d7bd8c5e88048587e6768d36eb695f3e7a25","analyzedAt":"2026-08-21T19:39:39.867Z","contentChangedAt":"2026-08-21T19:39:39.867Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}