Skip to content

ZoneIdEditor Add catch exception #33550

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

Closed
wants to merge 2 commits into from
Closed

ZoneIdEditor Add catch exception #33550

wants to merge 2 commits into from

Conversation

ngocnhan-tran1996
Copy link
Contributor

Issue #33545

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 17, 2024
setValue(ZoneId.of(text));
}
catch (Exception ex) {
throw new IllegalArgumentException("Failed to convert ZoneId for " + text, ex);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other editors that throw exceptions wrap the text inside ' chars, so "Failed to convert ZoneId for '" + text + "'" as the message. That way it is easy to identify trailing and/or leading spaces.

@jhoeller
Copy link
Contributor

Note that I've prepared a fix for #33545 locally already, just not committed it to the 6.1.x branch yet where it will get forward-merged to the main branch. This will get pushed to the repo later today.

@ngocnhan-tran1996 please pay attention to assignments on issues, otherwise an unrequested PR is effectively duplicated work. Thanks for your efforts, in any case!

In terms of exception message, I'm actually using the original exception message as-is without extra words or quoting of the value since the given value is contained there in the DateTimeException anyway. Also, we're exclusively catching DateTimeException there, not general Exception.

@jhoeller jhoeller closed this Sep 18, 2024
@jhoeller jhoeller added status: superseded An issue that has been superseded by another and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants