-
Notifications
You must be signed in to change notification settings - Fork 176
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
Exceptions in a LitRenderer causes "Internal error" #14091
Comments
The issue is not limited to the |
So is the expectation that the exception would be shown in the |
There is a change for 24.0.14, 24.1.8 and 24.2.0.alpha10 that run the custom ErrorHandler so it can update the UI and does not throw the internal error if there is a custom error handler set. |
Cherry picked into Flow 23.3. Wait for releases, estimation - this week. |
Yup, can be reproduced easily with: @Route("")
public class MainView extends VerticalLayout {
public MainView() {
final Grid<Integer> grid = new Grid<>(Integer.class);
add(grid);
grid.addColumn(new ComponentRenderer<>((SerializableSupplier<Component>) () -> {
throw new RuntimeException("Ha!");
})).setHeader("Ha");
add(new Button("Click", e -> grid.setItems(IntStream.range(0, 10).boxed().toList())));
}
} In general, I think this kind of response is received whenever exception is thrown when the response UIDL is being written. Since the UIDL is written to @caalador you mentioned a change already merged into Vaadin 24.2.0. However the bug is reproducible in Vaadin 24.3.5, so I wonder whether the PR landed? EDIT: wait, the DefaultErrorHandler seems to be notified!
Interesting. The exception is caught in
I wonder what is the reason for this kind of dichotomy in behavior: either the exception is Internal Error or it isn't, regardless of the ErrorHandler currently configured, and therefore the response should be the same. |
It's also possible to achieve "Internal error" even with custom error handler set: when the ErrorHandler itself throws an exception, then it bubbles out and reaches |
Regardless, this problem seems to be fixed, at least in Vaadin 24.3.5 and 23.3.33 - the custom ErrorHandler is notified and the "Internal Error" div is not shown. I propose to close this ticket as fixed. |
Description of the bug
causes
Expected behavior
The exception is passed to the error handler
Minimal reproducible example
See above
Versions
Vaadin: 23.1.2
Flow: 23.1.2
Java: Homebrew 11.0.12
OS: aarch64 Mac OS X 12.4
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
The text was updated successfully, but these errors were encountered: