Search Unity

Stopping Exception report after first Exception

Discussion in 'Unity Cloud Diagnostics' started by KarimTA, Aug 28, 2019.

  1. KarimTA

    KarimTA

    Joined:
    Jan 8, 2019
    Posts:
    27
    Hi, I wanted to try disabling exception reporting after the first exception occured to avoid false positives.

    My issue is that I catch the exception event through Application.logMessageReceived. I wanted to set enableCaptureExceptions to false upon receiving an Exception LogType.

    However, how can I be sure that the exception that triggered the logMessageReceived callback has been correctly sent? I wouldn't want to miss that one.

    Is it safe to disable the exception right there and then or should I wait for a frame or two?
     
  2. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    Hi @KarimTA, CrashReportHandler.enableCaptureExceptions would prevent any exceptions from being reported if those exceptions occurred after being set. The report-sending process is asynchronous, so if an exception occurs before CrashReportHandler.enableCaptureExceptions is set to false then that report will still be in the process of being sent and should go through with no issues. So in short, it should be safe to disable the exception reporting right then and there without waiting an additional frame. However, please do some testing just to be sure.