Skip to content

Commit 12eef00

Browse files
authored
Fix logging of driver errors containing bigints in testkit backend (#1280)
The JavaScript driver testkit backend handles all ints as bigints, when these end up in some errors (as in syntax errors on 2025.x servers) they cause the backend to crash. This commit solves the issue by using a replacer function.
1 parent a931816 commit 12eef00

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/testkit-backend/src/request-handlers.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import ResultObserver from './result-observer.js'
33
import { cypherToNative, nativeToCypher } from './cypher-native-binders.js'
44
import { nativeToTestkitSummary } from './summary-binder.js'
55
import tls from 'tls'
6+
import stringify from './stringify.js'
67

78
const SUPPORTED_TLS = (() => {
89
if (tls.DEFAULT_MAX_VERSION) {
@@ -180,7 +181,7 @@ export function ResultNext (context, data, wire) {
180181
}
181182
})
182183
.catch(e => {
183-
console.log('got some err: ' + JSON.stringify(e))
184+
console.log('got some err: ' + stringify(e))
184185
wire.writeError(e)
185186
})
186187
}
@@ -272,7 +273,7 @@ export function TransactionCommit (context, data, wire) {
272273
tx.commit()
273274
.then(() => wire.writeResponse('Transaction', { id }))
274275
.catch(e => {
275-
console.log('got some err: ' + JSON.stringify(e))
276+
console.log('got some err: ' + stringify(e))
276277
wire.writeError(e)
277278
})
278279
}

0 commit comments

Comments
 (0)