Is there any kind of mechanism to listen for or observe errors at runtime like a callback? Is this all done through the console log? i’m trying to determine how i could determine which errors are “catastrophic”, which are coming from needle, and which are coming from Unity!
A failure for the needle engine to initialize in the browser comes to mind. Is that too broad? I’m specifically curious if there’s a unified error stream of some kind that the engine provides, or if instead all errors are dumped to the console, including those directly from say, Unity?
Unity errors will never show up in the browser - you’ll see those in the Unity console as usual (Unity has nothing to do with your scene anymore once you’re in the browser)
What you can use for getting specific or all exceptions in the browser is: window.addEventListener("error", (event) => { and
or window.addEventListener("unhandledrejection", (event) => { for example
Okay that’s extremely useful thanks! It’d also be helpful to know if there is a particular formatting for errors that come from needle internals that suggest that a raised error is catastrophic in nature i.e experience ending - but that may be up to the client developer to determine?
Errors from the core should never be catastrophic in nature, otherwise we would certainly treat that as bug.
There’s some errors logged as “Not Supported:” for particular component creation scenarios, and otherwise we’re differentiating between errors and warnings and lean towards warnings for things that don’t affect operation (e.g. when you incorrectly call some methods we warn instead of error).