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

Improve error message when reading NaN (PostgreSQL) #3494

Open
janpio opened this issue Sep 1, 2020 · 0 comments
Open

Improve error message when reading NaN (PostgreSQL) #3494

janpio opened this issue Sep 1, 2020 · 0 comments
Labels
kind/improvement An improvement to existing feature and code. team/client Issue for team Client. tech/engines Issue for tech Engines. topic: error topic: floating point types Topic related to floating point types and precision loss topic: NaN

Comments

@janpio
Copy link
Member

janpio commented Sep 1, 2020

When trying to read a float column with a NaN value you get the following error message both with find* and the raw API:

PrismaClientRustPanicError:
Invalid `prisma.queryRaw()` invocation:

PANIC: f64 is not a Decimal: Error { message: "Invalid decimal: invalid character" }

This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic.

          at PrismaClientFetcher.request (/Users/divyendusingh/Documents/prisma/triage/prisma-client-js-797/node_modules/@prisma/client/runtime/index.js:1:227975)
          at processTicksAndRejections (internal/process/task_queues.js:97:5)

This was reported in prisma/prisma-client-js#797.

As the Prisma Engines currently do not support NaN at all (feature request tracked at #3492), we should output a more helpful error message to the user.

(Rough technical information from a conversation with Julius: When we read the data, we can check if it is NaN and fail harder instead of trying to convert it to decimal which causes the panic listed above)

The error message can possibly also link to a documentation article that explains this limitation or Prisma further.

@janpio janpio added kind/improvement An improvement to existing feature and code. topic: error tech/engines Issue for tech Engines. topic: floating point types Topic related to floating point types and precision loss topic: NaN labels Sep 1, 2020
@pantharshit00 pantharshit00 added the team/client Issue for team Client. label Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement An improvement to existing feature and code. team/client Issue for team Client. tech/engines Issue for tech Engines. topic: error topic: floating point types Topic related to floating point types and precision loss topic: NaN
Projects
None yet
Development

No branches or pull requests

2 participants