fix(server): catch panic for context parsing (#10912)

fix AF-2335
fix CLOUD-173
This commit is contained in:
darkskygit
2025-03-17 09:44:57 +00:00
parent b401012d85
commit 92db9a693a
4 changed files with 129 additions and 71 deletions

View File

@@ -10,6 +10,7 @@ import {
Config,
EventBus,
JobQueue,
mapAnyError,
OnEvent,
OnJob,
} from '../../../base';
@@ -160,10 +161,11 @@ export class CopilotContextDocJob implements OnModuleInit {
chunkSize: total,
});
} catch (e: any) {
this.logger.error(
`Failed to embed pending file: ${contextId}::${fileId}`,
e
);
const error = mapAnyError(e);
error.log('CopilotJob', {
workspaceId,
fileId,
});
this.event.emit('workspace.file.embed.failed', {
contextId,