- Home /
Getting exception message from batchmode execution
I'm trying to setup a build automation system for our project. I'm using batch file like this:
Unity.exe -quit -batchmode -projectPath %cd% -executeMethod MyClass.BuildFromCmdLine -myClassParam param
I'm doing some sanity checks in my BuildFromCmdLine() methods and if these checks fails, I throw exceptions with detailed explanations. The problem is that when exception happens the text is not displayed in the console, only the generic message
executeMethod method MyClass.BuildFromCmdLine threw exception. Is it possible to get the actual exception message displayed somehow? The only way I found right now is to use "-logFile" command to log everything during the build, but I'd prefer to have the error displayed at instant in the console.Aborting batchmode due to failure:
Answer by Bunny83 · Jan 08, 2013 at 12:41 PM
You have to catch your exceptions yourself. Just display a dialog or print a message to the log
I don't think I can display a dialog as this is a "-batchmode" windowless build. Printing to the log has no advantage over the exceptions, as exceptions are logged by themselves.
Your answer
![](https://koobas.hobune.stream/wayback/20220613090603im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Compiling HDRP/Lit shader takes 41 minutes, how can I reduce this? 1 Answer
Default Build File Extension 0 Answers
"Automatic" XCode project generation on Windows 2 Answers
HDRP build not showing objects 0 Answers