-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
DateTimeException misclassified as INTERNAL_ERROR #5924
Comments
The |
It might be better to just validate the range of values for each field directly. There's an opportunity for producing better error messages. |
I'll try to do this one; assigned to myself. Found that it can be reproduced with: select cast('2020-01-01 24:01:01' as timestamp)
And it does report INTERNAL_ERROR/GENERIC_INTERNAL_ERROR (65536) on the UI. |
The catch (DateTimeException e) {
//Leverage highly specific error message from the source exception.
throw new PrestoException(INVALID_CAST_ARGUMENT,
String.format("Value cannot be cast to timestamp; %s. ", e.getMessage()), e);
} Produces a user-error like:
or:
For these two bad cast values respectively. select cast('2020-13-01 23:61:01' as timestamp);
select cast('2020-13-01 23:59:01' as timestamp); Does this look okay to you approach-wise? |
@martint - Made a PR with the above fix and some text cases for you to review. Happy to change it if you have any issues. Thanks! |
This is still listed as Open, but it looks like it has been fixed. Is that correct? |
@rnzucker Thanks for bumping this up - I see the PR is still open
EDIT: I apparently misread the issue, it's still classified as an INTERNAL_ERROR. The PR needs to be rebased and should be good to go then. |
Okay. I was just looking for issues for my son to start on for his first OSS project (in Java). Hence my question. |
I see this has been handled already with newer version. @hashhar can you close this issue? |
Yes, I can confirm too. Thanks for verifying @sthandassery. |
Seeing the following exception which ends up being classified as an INTERNAL_ERROR instead of a USER_ERROR:
The text was updated successfully, but these errors were encountered: