Skip to content

Commit 369ed33

Browse files
committed
address copilot comment
1 parent 4e0eef5 commit 369ed33

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/common/logger.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const LogId = {
4141

4242
mongodbConnectFailure: mongoLogId(1_004_001),
4343
mongodbDisconnectFailure: mongoLogId(1_004_002),
44+
mongodbConnectTry: mongoLogId(1_004_003),
4445

4546
toolUpdateFailure: mongoLogId(1_005_001),
4647
resourceUpdateFailure: mongoLogId(1_005_002),

src/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export class Server {
245245
if (this.userConfig.connectionString) {
246246
try {
247247
this.session.logger.info({
248-
id: LogId.serverInitialized,
248+
id: LogId.mongodbConnectTry,
249249
context: "server",
250250
message: `Detected a MongoDB connection string in the configuration, trying to connect...`,
251251
});
@@ -257,7 +257,7 @@ export class Server {
257257
this.session.logger.error({
258258
id: LogId.mongodbConnectFailure,
259259
context: "server",
260-
message: `Failed to connect to MongoDB instance using the connection string from the config: ${error as string}`,
260+
message: `Failed to connect to MongoDB instance using the connection string from the config: ${error instanceof Error ? error.message : String(error)}`,
261261
});
262262
}
263263
}

0 commit comments

Comments
 (0)