Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Crash Handling Functionality

Discussion in 'Scripting' started by MRKane, Nov 18, 2014.

  1. MRKane

    MRKane

    Joined:
    Oct 4, 2012
    Posts:
    54
    Hello all,

    We're up to the deployment stage of our Unity product and are running with the Pro licence. I've recently set my sights on a more helpful method of collecting additional crash information by looking into recording log messages with the likes of Application.RegisterLogCallback and while it's useful for catching Warnings, Exceptions, Errors - that sort of stuff, on all platforms - it's not able to catch "hard crashes" where everything abruptly falls down. There are a couple of assets people have constructed to this extent on the Asset Store.

    What I was wondering was if there was an internal ticker or notification for the number of times the player had crashed, if it crashed last run which is something that we could really use with mopping up the last issues as they're becoming rare and difficult to reproduce, and the usual crash information isn't essentially useful when the state of the project would provide more insight.

    Any idea about OnCrash() or Application.CrashedLastPlay style functions or values?

    Much obliged for any information!
     
  2. Rvalt_

    Rvalt_

    Joined:
    Dec 2, 2021
    Posts:
    2
    Hi,
    I would be interested to know if you found something out about CrashHandling. I'm currently researching about crash handling for unity, when the unity application is used as a .dll inside another main host program.
    Do you have any guesses or experience with that?
    Beste regards
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,501
    Please don't necro-post to eight-year-old threads for stuff that is easily found via Google.

    Unity supports crash reporting through their services. Go look at the services documentation.

    If that's not enough for you then reach for any one of the many third parties: crashlytics / firebase, stacktrace, flurry, etc.

    Be prepared for an extremely annoying fiddly-diddly hacka-hacka-hacka mess trying to integrate any of these things, especially firebase / crashlytics. You have been warned.
     
  4. Rvalt_

    Rvalt_

    Joined:
    Dec 2, 2021
    Posts:
    2
    Thanks a lot for your response!

    You are right. For general Unity crash handling there is a lot to find. But for crash handling for a Unity application that is embedded as a .dll in a .NET process it gets tricky.
    The motivation being to use Unity as a embedded 3D environment (as a .dll) inside a host .NET process. In case of a crash in this 3D environment .dll we like to get some crash information to write them into a log file or display something to user. What would you do to handle crashes for this Unity embedded use case?

    Meanwhile, I will take a look at your mentioned third party tools.
    Thanks for the warning ;).
     
    Last edited: Sep 21, 2022