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. ryanc-unity

    ryanc-unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    1,209
    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.
     
    EmpyreanDeveloper likes this.