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

前端 未结 9 608
梦如初夏
梦如初夏 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:44

    It depends on what you mean by "resume". The trouble with exceptions is that unless you're very careful, by the time an exception happens your application state is quite possibly corrupt - you might have completed half an operation.

    If you can isolate your operations - much like a database isolates transactions - then you can effectively let your user resume from the "last commit point". That will very much depend on the type of your application though. Could you give us more details about the kind of application you're building?

提交回复
热议问题