Structured errors for parsing overflowing ints #2921
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issues:
Option::unwrap()
on aNone
value in query-engine/core/src/query_document/parser.rs:250:87 prisma#12737Option::unwrap()
on aNone
value in query-engine/core/src/query_document/parser.rs:250:87 prisma#12491Option::unwrap()
on aNone
value in query-engine\core\src\query_document\parser.rs:250:87 prisma#10586Option::unwrap()
on aNone
value in query-engine/core/src/query_document/parser.rs:250:87 prisma#12654upsert
causes: "PANIC: calledOption::unwrap()
on aNone
value in query-engine/core/src/query_document/parser.rs:250:87" prisma#10049Option::unwrap()
on aNone
value in query-engine/core/src/query_document/parser.rs:250:87 prisma#11467Option::unwrap()
on aNone
value in query-engine/core/src/query_document/parser.rs:250:87 prisma#11263Option::unwrap()
on aNone
value in query-engine/core/src/query_document/parser.rs:250:87 prisma#9896Option::unwrap()
on aNone
value in query-engine/core/src/query_document/parser.rs:250:87 prisma#13293Makes sure the engine doesn't crash on encountering an integer serialized as float that is outside of the i64 range (surfaced as P2009). Introduces a less concrete P2033 error code for when the GraphQL parser errors on an int that doesn't fit. The reason for the separate error is that we have very little actual information on that parsing stage, plus the later parsing error (where the unwrap tickets point to) is on a completely different layer with more info, which can't easily be propagated as a different error code than the enclosing parser error (P2009).
Example P2009:
Example P2033: