Open daren-thomas opened 8 years ago
Hi Daren, i found something to avoid errors and crashes, with ExecuteAndWrap maybe it can replace the first test too ?(var command = scriptSource.Compile(errors);)
{
executing = true;
var errors = new ErrorReporter();
var command = scriptSource.Compile(errors);
if (command == null)
{
// compilation failed
error = "Syntax Error: " + string.Join("\nSyntax Error: ", errors.Errors) + "\n";
}
else
{
var harderrors = new ErrorReporter();
var h_error = new ObjectHandle(harderrors);
GetCommandDispatcher()(() => scriptSource.ExecuteAndWrap(commandLine.ScriptScope, out h_error));
if (h_error != null)
{
error = harderrors.Errors + "\n";
}
}
}
Hi @PMoureu,
could you please post a pull request?
Thank you!
When running code in the console on R2015 or 2016, if there is an uncaught error then the console becomes irresponsive to shortcuts (save, run, copy, paste etc). It essentially means you need to close the console, re-open, re-load your script to carry on working with ease.