我在客戶端上使用GWTP和RequestFactory。GWT的UncaughtExceptionHandler沒有被調用(使用GWTP和RF)
我想任何致命異常由自定義UncaughtExceptionHandler處理。我創建我的自定義處理程序,並在我的入口點模塊的配置()調用註冊它:
public class ClientModule extends AbstractPresenterModule {
@Override
protected void configure() {
// Register Uncaught Exception Handler first thing
GWT.setUncaughtExceptionHandler(new CustomUncaughtExceptionHandler());
...
但是,如果我的客戶對我拋出一個異常
throw new RuntimeException("test");
異常沒有被捕獲。在開發模式下,我看到未捕獲的異常一直到開發控制檯。進一步調試表明,GWT還沒有註冊我的自定義處理程序:
handler = GWT.getUncaughtExceptionHandler();
回報
[email protected]70563b1
任何想法上爲什麼GWT.setUncaughtExceptionHandler不工作?
對於記錄,我遵循cleancodematters這post。他的實現和我的唯一區別在於我在客戶端使用GWTP(和GIN)。
我肯定錯過了一點信息。感謝您指出! – manubot