Skip to content

Commit 368dc92

Browse files
committed
Add debug calls
1 parent 0c7549e commit 368dc92

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

package-lock.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mongodb-build-info/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"typescript": "^5.0.4"
7878
},
7979
"dependencies": {
80+
"debug": "^4.4.0",
8081
"mongodb-connection-string-url": "^3.0.0"
8182
}
8283
}

packages/mongodb-build-info/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import ConnectionString from 'mongodb-connection-string-url';
2+
import { debug as createDebug } from 'debug';
3+
4+
const debug = createDebug('mongodb-build-info');
25

36
type Document = Record<string, unknown>;
47

@@ -167,6 +170,7 @@ export async function identifyServerName(
167170
try {
168171
await adminCommand({ getParameter: 'foo' });
169172
} catch (error) {
173+
debug('getParameter command failed %O', error);
170174
if (error instanceof Error && /documentdb_api/.test(error.message)) {
171175
return 'pg_documentdb';
172176
}

0 commit comments

Comments
 (0)