Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

OSX Build Unhandled Exceptions

Discussion in 'macOS' started by redeyesofnight, Feb 7, 2018.

  1. redeyesofnight

    redeyesofnight

    Joined:
    May 2, 2011
    Posts:
    1
    I’ve been recently tasked with supporting Mac builds of a soon-to-release game, and we have been encountering many hard crashes due to unhandled exceptions.

    I know that the proper fix for these are null checks and try/catch blocks where necessary, but we are looking at least for some info on why this behavior exists on Mac (and at best, a magic fix. I know, unlikely).

    The main question I have here is this: Unity editor on Mac catches unhandled exceptions (null references and the like), and presents them as debug info rather than crashing the editor. This suggests to me that some global exception handler exists in the editor.

    What is the reason that a build for OSX cannot catch these and present them as errors rather than crashing the app? Is there a logging level setting that controls this? I know we can intercept unity logging, but that is not actually handling the exception.

    Given proper time, if it is deemed worthwhile, the real solution is to handle these ourselves, but if anyone could shed some light on the topic, or have any tips, it would be appreciated.
     
  2. robinryf

    robinryf

    Joined:
    May 22, 2014
    Posts:
    54
    Have you been able to solve this? Or find a setting that allows catching exceptions on macOS?