Monotouch Global Exception handling

后端 未结 2 1205
刺人心
刺人心 2021-02-19 08:39

I am having a nasty bug show up in the wild, and I can\'t put my finger on it. Is there a way to have a Global Try/Catch block, or a way to handle any exception that is unhanded

2条回答
  •  广开言路
    2021-02-19 09:01

    I have had success with using the unhandled exception handler, ie AppDomain.CurrentDomain.UnhandledException event. This seems to catch many (but not all) unhandled exceptions. It seems that crashes that are in unmanaged code can cause the app to fail without calling this event.

    Geoff: would capturing this event in addition to catching exceptions falling out of UIApplication.Main make sense or would one of the methods be preferred?

提交回复
热议问题