Skip to content

Commit 55fcf19

Browse files
committed
Preserve err stack trace info
1 parent 49ca894 commit 55fcf19

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/compass-generative-ai/src/atlas-ai-service.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,8 @@ export class AtlasAiService {
495495
try {
496496
const data = await res.json();
497497
return MockDataSchemaResponseShape.parse(data);
498-
} catch {
499-
const errorMessage = 'Response does not match expected schema';
498+
} catch (err) {
499+
const errorMessage = err instanceof Error ? err.stack : String(err);
500500
this.logger.log.error(
501501
mongoLogId(1_001_000_311),
502502
'AtlasAiService',
@@ -506,7 +506,9 @@ export class AtlasAiService {
506506
message: errorMessage,
507507
}
508508
);
509-
throw new AtlasAiServiceApiResponseParseError(errorMessage);
509+
throw new AtlasAiServiceApiResponseParseError(
510+
'Response does not match expected schema'
511+
);
510512
}
511513
}
512514

0 commit comments

Comments
 (0)