Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certain errors terminate process async with unhelpful error (e.g. incorrect user and/or password) #140

Open
andyjy opened this issue Feb 1, 2025 · 0 comments · May be fixed by #141
Open

Comments

@andyjy
Copy link
Contributor

andyjy commented Feb 1, 2025

Steps to reproduce

Try connect to Neon with incorrect username and/or password

Expected result

error event listeners fire on NeonPool and the cause of the error as returned by the Neon postgres server is thrown up to the calling application code.

e.g. when using via the Prisma adaptor:

PrismaClientUnknownRequestError: 
Invalid `prisma.$executeRaw()` invocation:

Error in connector: Error querying the database: ERROR: no such user
    at Vn.handleRequestError (.../node_modules/@prisma/client/runtime/library.js:121:7530)
    at Vn.handleAndLogRequestError (.../node_modules/@prisma/client/runtime/library.js:121:6663)
    at Vn.request (.../node_modules/@prisma/client/runtime/library.js:121:6370)
    at async l (.../node_modules/@prisma/client/runtime/library.js:130:9617) {
  jse_shortmsg: 'PrismaClientUnknownRequestError: \n' +
    'Invalid `prisma.$executeRaw()` invocation:\n' +
    '\n' +
    '\n' +
    'Error in connector: Error querying the database: ERROR: no such user'

Actual result

An unhelpful error is thrown immediately, terminating the process async from the call site:

Error: Connection terminated unexpectedly
    at fn.<anonymous> (.../node_modules/@neondatabase/serverless/index.mjs:1250:44)
    at Object.onceWrapper (.../node_modules/@neondatabase/serverless/index.mjs:410:15)
    at fn.emit (.../node_modules/@neondatabase/serverless/index.mjs:397:12)
    at v.<anonymous> (.../node_modules/@neondatabase/serverless/index.mjs:1202:66)
    at v.emit (.../node_modules/@neondatabase/serverless/index.mjs:397:12)
    at WebSocket.<anonymous> (.../node_modules/@neondatabase/serverless/index.mjs:988:51)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:816:20)
    at WebSocket.dispatchEvent (node:internal/event_target:751:26)
    at fireEvent (node:internal/deps/undici/undici:11547:14)
    at TLSSocket.onSocketClose (node:internal/deps/undici/undici:11946:7)
@andyjy andyjy linked a pull request Feb 1, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant