Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught error in the console on R2015 - console becomes irresponsive to shortcuts #33

Open
daren-thomas opened this issue Nov 11, 2015 · 2 comments
Assignees

Comments

@daren-thomas
Copy link
Member

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.

@PMoureu
Copy link
Contributor

PMoureu commented Jun 20, 2016

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";
                        }
                    }                    
                }

@daren-thomas
Copy link
Member Author

Hi @PMoureu,

could you please post a pull request?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants