Search Unity

How to upload crash report manually?

Discussion in 'Unity Cloud Diagnostics' started by FrozenDistrict, Sep 24, 2019.

  1. FrozenDistrict

    FrozenDistrict

    Joined:
    Oct 27, 2018
    Posts:
    2
    Hi,

    We are happy users of Cloud Diagnostics in our desktop game. As it is available to players, we try to avoid crashes - that's why sometimes we do error handling, like null-checks or try/catch blocks.

    Unfortunately, as far as I understand, If there is no Exception (or if an exception is handled in a try/catch block), then report to Cloud Diagnostics will not be sent.

    We have many players. If for one of them the game save file will break, it is a critical error, because the player will lose all his progress. In such a case, we will show him error popup, and still let him play the new game. We want to upload a crash report for such a situation (because it is a significant error). Unfortunately, the only way I know to do that is sending unhandled exception (which, as far as I understand, could easily break anything in the game).

    Is there any way to send a crash report via "normal" Upload function instead of using unhandled exceptions?
     
  2. Ryan-Unity

    Ryan-Unity

    Joined:
    Mar 23, 2016
    Posts:
    1,993
    Hi @FrozenDistrict, I'm glad to hear that you enjoy using Cloud Diagnostics! :D

    If you'd like to send an Exception report without interrupting the flow of your code then you can use the following line of code to do that:

    Debug.LogException(new Exception("<Exception Message>"));

    Then you can replace the Exception Message with whatever info you'd like to pass along with the stack trace in the report.
     
  3. hesilling

    hesilling

    Joined:
    Dec 5, 2020
    Posts:
    1
    Hi ryanc!
    Our game has an exception handling system, but we also want cloud diagnostics. So we have the same problem. But Debug.LogException is not sent to the cloud diagnostics in the editor environment, the unhandled exception will be sent. Debug.LogException Can it really be captured by cloud diagnostics?

    I found that I had made a stupid mistake. Cloud diagnostics shows on, but not actually on. it's ok.
     
    Last edited: Dec 5, 2020