public static RubyErrorProvider FromMessageAndBacktrace(MutableString message, RubyArray backtrace) { var rep = new RubyErrorProvider(); rep.ParseFromBacktrace(message, backtrace); return(rep); }
private void ScriptThreadProc() { ScriptScope scope = null; try { m_runningScript = true; var rep = RubyErrorProvider.AsErrorSink(); var compiledCode = m_scriptSrc.Compile(rep); if (compiledCode != null) { scope = compiledCode.DefaultScope; compiledCode.Execute(); ScriptHelper.SpinLoop(0.5, scope); } else { TriggerErrorEvent(rep); } } catch (ThreadAbortException) { // We don't want to do anything special about thread aborts, // since these are usually invoked by the user } catch (Exception ex) { TriggerErrorEvent(RubyErrorProvider.ParseException(ex)); } finally { // only execute if no syntax errors if (scope != null) { ScriptHelper.SendMethodToModules("onFinish", scope); ScriptHelper.ExecuteTopMethod("onFinish", scope); } m_runningScript = false; OnCompileFinished(); } }
public static RubyErrorProvider FromMessageAndBacktrace(MutableString message, RubyArray backtrace) { var rep = new RubyErrorProvider(); rep.ParseFromBacktrace(message, backtrace); return rep; }
private void TriggerErrorEvent(RubyErrorProvider rep) { OnScriptError(rep.Message, rep.Path, rep.Line, rep.Column, rep.Format); }
private void TriggerErrorEventFromRuby(MutableString message, RubyArray backtrace) { TriggerErrorEvent(RubyErrorProvider.FromMessageAndBacktrace(message, backtrace)); }