的Vaadin web框架显示任何未捕获的异常红色的误差警报:Vaadin自定义错误消息
内部错误
请通知管理员
...
Vaadin文档描述了how to set a custom error handler。
当我提供一个自定义错误处理程序时,默认的红色错误警报仍然显示。当用户解除该错误警报时,将出现自定义错误警报。我只想显示自定义错误警报。如何禁用默认的“内部错误”警报?
下面是我vaadin应用类的重写terminalError方法:
@Override public void terminalError(Terminal.ErrorEvent event) {
// Call the default implementation.
super.terminalError(event);
// Some custom behaviour.
if (getMainWindow() != null) {
getMainWindow().showNotification(
"An unchecked exception occured!",
event.getThrowable().toString(),
Notification.TYPE_ERROR_MESSAGE);
} }
即使我注释掉对super.terminalError(event)的调用,它也会显示内置的“内部错误” – byneri
当我使用您发布的链接中使用的terminalError(Terminal.ErrorEvent事件)方法时,它仍然显示内置的“内部错误” – byneri
没有抱歉。我引用了该方法以向您显示它正在设置组件错误。我的问题是你可以删除/清除该错误?像'setComponentError(null)'。 –