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

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

No files matched your search

@@ -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,