- Home /
Best way to handle exceptions in release
What is the best way to throw errors in your game?
I was trying to using actual exceptions, but Unity is a bit different than normal applications since they have an entry point and unity doesn't.
So now, I am trying to throw new Exception()
, but this doesn't seem to be the way. Debug.LogError
is only for debug modes. How can I make sure that EVERY exception is caught in the release build and the user gets a nice error on the screen and the exception is nicely logged to a log manager?
I don't know what you mean by "Debug.LogError is only for debug modes." It always prints to the log file regardless.
Debug.LogError
only prints a statement to the unity console. But does it also log to a file? And is this the appropriate way of catching a real C#
exception? It feels a bit tricky.
Hi Dave Carlile,
I am writing this to contact you, because there is no other way for this. Eventhough my comments are pointing out the same plugin for the same kind of problem, you can not deny it is helpful and solving their problem. I don't intend to spam around, but I have developed a helpful plugin and want people to profit from it. I also myself find a lot of useful plugin referance from unity3d blog.
Regards
Just following the rules. Answering a bunch of old questions with a link to your product is spam. We'll usually let a very few go through, but once it gets excessive it's stopped. Simple as that. If you want to advertise your asset store product there are places in the forums where you can create a thread about it. Unity Answers is not the place for it.
Also, please use Comments for discussion and reserve Answers for answers to the actual question. I converted your answer to a comment for you.
Answer by timsk · Oct 05, 2011 at 09:30 AM
Check out this thread:
http://answers.unity3d.com/questions/20147/global-error-logging-and-overflow-checking.html
It mentions Application.RegisterLogCallBack
Which might be what your looking for.
That is not quite what I'm looking for. I want to handle ALL my exceptions. Even simple ones like: filenotfoundexception
. RegisterLogCallBack
only lets me have an extra call when a log is called.
I am looking for: "there is an exception somewhere in code: where to I leave it, how can I be certain that my application doesn't crash?"
Your answer
Follow this Question
Related Questions
TlsException error only on windows 10 (not mac) 0 Answers
Despawner script returns null reference exception. 0 Answers
Multiple Cars not working 1 Answer
I'm getting a StackOverFlowException 1 Answer
Distribute terrain in zones 3 Answers