feat(observability): add exception filter, logging interceptor, and CodeExecutorModule

- add HttpExceptionFilter logging BadRequestException at warn and InternalServerErrorException at error with cause chain
- add LoggingInterceptor logging request/response pairs at debug level with method, path, body, status, and duration
- extract CodeExecutorService into standalone CodeExecutorModule imported by BrowserModule and McpModule
- thread { cause: err } into all catch blocks across auth, browser, and code-executor services
This commit is contained in:
2026-04-07 13:49:02 +03:00
parent bf1b6249a9
commit 5ac26ecb3a
13 changed files with 168 additions and 19 deletions
+3 -2
View File
@@ -60,8 +60,8 @@ export class AuthService {
let descriptor: KeyDescriptor;
try {
descriptor = JSON.parse(fs.readFileSync(keyJsonPath, 'utf-8'));
} catch {
throw new BadRequestException(`Cannot read key descriptor: ${keyId}`);
} catch (err) {
throw new BadRequestException(`Cannot read key descriptor: ${keyId}`, { cause: err });
}
const keyFilePath = path.resolve(this.keysDir, descriptor.keyFile);
@@ -130,6 +130,7 @@ export class AuthService {
this.logger.error(`Login failed: ${(err as Error).message}`);
throw new InternalServerErrorException(
`Login automation failed: ${(err as Error).message}`,
{ cause: err },
);
} finally {
await browser.close();