Beispiel #1
0
 public override void FireEvent(ScriptEvent @event, Program program)
 {
     try
     {
         var programAPI     = new RekoProgramAPI(program);
         var programWrapper = pythonAPI.CreateProgramWrapper(
             programAPI);
         eventsAPI.FireEvent(@event, programWrapper);
     }
     catch (Exception ex)
     {
         eventListener.Error(
             new NullCodeLocation(Filename),
             ex,
             "An error occurred while running the Python script.");
         DumpPythonStack(ex, engine);
     }
 }
Beispiel #2
0
        public override void FireEvent(ScriptEvent @event, Program program)
        {
            var eventsAPI = this.eventsAPI;
            var engine    = eventsAPI.Engine;

            try
            {
                var pythonAPI      = new PythonAPI(cfgSvc, fsSvc, engine);
                var programAPI     = new RekoProgramAPI(program);
                var programWrapper = pythonAPI.CreateProgramWrapper(
                    programAPI);
                eventsAPI.FireEvent(@event, programWrapper);
            }
            catch (Exception ex)
            {
                var scriptError = CreateError(
                    Location.FilesystemPath,
                    ex,
                    "An error occurred while running the Python script.",
                    engine);
                eventListener.Error(scriptError);
                DumpPythonStack(outputWriter, ex, engine);
            }
        }