Hi
AppUI.showCriticalExceptionMessage() is very basic, does not even use its Exception parameter, and cannot be extended (at least I see no trivial way).
It would be nice if we can hook up a Factory in there to produce the Vaadin form.
For instance, instead of retrying the application initialization we would like to be able to define a redirection to another url.
Mike
artamonov
(Yuriy Artamonov)
February 27, 2018, 1:27pm
#3
Hi,
You can extend AppUI in your application and override showCriticalExceptionMessage
method:
Create CustomAppUI class in web module:
public class CustomAppUI extends AppUI {
@Override
protected void showCriticalExceptionMessage(Exception exception) {
// todo do something
}
}
Register it in web-spring.xml config:
<bean id="cuba_AppUI" class="com.company.appui.web.CustomAppUI" scope="vaadin"/>
Now, you can implement custom exception handling in AppUI.
Iām not sure that we should provide additional flexibility there, since this exception handler is used only if the initial page cannot be rendered and an exception caught during the page opening.
1 Like
Perfect, thanks Yuriyy. I tend to forget how extensible CUBA is. Indeed no need to do more regarding flexibility.