How to implement one “catch'em all” exception handler with resume?

前端 未结 9 621
梦如初夏
梦如初夏 2020-11-29 07:07

I wonder how can I write a catch\'em all exception handler in the application level which will give the user the option to resume the application f

9条回答
  •  孤独总比滥情好
    2020-11-29 07:39

    I don't think this is really feasible using a global error handler. You need to figure out what kind of errors are recoverable at different points in your application and write specific error handlers to address the errors as they occur -- unless you want to resort to application restart, which may or may not work depending on what the actual error is. In order to do any kind of resume, you'll need to save enough state to restart from a known good state.

提交回复
热议问题