Skip to content

Commit 004fce9

Browse files
committed
also log when resolveMongodbSrv fails
1 parent db5a02d commit 004fce9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

packages/compass/src/app/utils/telemetry.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,20 @@ async function getHostnameForConnection(
158158
);
159159
if (connectionStringData.isSRV) {
160160
const uri = await resolveMongodbSrv(connectionStringData.toString()).catch(
161-
() => {
161+
(err: unknown) => {
162+
debug(
163+
`resolveMongodbSrv failed for "${connectionStringData.hosts.join(
164+
','
165+
)}": ${(err as Error).message}`
166+
);
167+
168+
log.warn(
169+
mongoLogId(1_001_000_340),
170+
'resolveMongodbSrv',
171+
'Failed to resolve mongodb srv for telemetry',
172+
{ hosts: connectionStringData.hosts, error: (err as Error).message }
173+
);
174+
162175
return null;
163176
}
164177
);

0 commit comments

Comments
 (0)