的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)'。 –