Inheritance: System.ApplicationException
        public void Setup()
        {
            var frc = new FlowRuntimeConfiguration();
            frc.AddPushCausality("push");
            frc.AddPopCausality("pop");

            frc.AddFunc<int, int>("exOn0", i =>
                                                {
                                                    if (i == 0)
                                                        throw new ApplicationException("on0");
                                                    return i;
                                                });
            frc.AddFunc<int, int>("exOn1", i =>
                                                {
                                                    if (i == 1)
                                                        throw new ApplicationException("on1");
                                                    return i;
                                                });
            frc.AddAction<int>("exOn2", i =>
                                                {
                                                    if (i == 2)
                                                        throw new ApplicationException("on2");
                                                });

            _exCausality = null;
            _are = new AutoResetEvent(false);
            frc.AddAction<FlowRuntimeException>("handleEx", _ =>
                                                                   {
                                                                       _exCausality = _;
                                                                       _are.Set();
                                                                   });

            frc.AddStream(new Stream(".in", "push"));
            frc.AddStream(new Stream("push", "exOn0"));
            frc.AddStream(new Stream("push.exception", "handleEx"));
            frc.AddStream(new Stream("exOn0", "exOn1"));
            frc.AddStream(new Stream("exOn1", "pop"));
            frc.AddStream(new Stream("pop", "exOn2"));

            _fr = new FlowRuntime(frc);

            _exUnhandled = null;
            _fr.UnhandledException += _ => {
                                                _exUnhandled = _;
                                                _are.Set();
                                           };
        }
示例#2
0
文件: GUI.cs 项目: ralfw/dnp2012
 public void Fehler_anzeigen(FlowRuntimeException ex)
 {
     MessageBox.Show(ex.ToString(), "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
 }
 public UnhandledFlowRuntimeException(FlowRuntimeException exception)
     : base("Unhandled exception during operation execution! Missing exception event handler or causality.", exception.InnerException, exception.Context)
 {
 }
示例#4
0
文件: WinMain.cs 项目: ralfw/dnp2012
 //[DispatchedMethod]
 public void Fehler_melden(FlowRuntimeException ex)
 {
     MessageBox.Show(string.Format("Es ist ein Fehler aufgetreten:\n{0}\n\nAuslösende Nachricht:\n{1}", ex.InnerException.Message, ex.Context), "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
 }
 private void Catch_exception_with_causality(Task task, FlowRuntimeException ex)
 {
     var c = task.Message.Causalities.Peek();
     var cMsg = new Message(c.Port, ex, task.Message.CorrelationId);
     HandledException(cMsg);
 }
示例#6
0
 static void Handle_exception(FlowRuntimeException ex)
 {
     Console.WriteLine("*** Exception during file processing: {0}", ex.InnerException);
 }
示例#7
0
 public UnhandledFlowRuntimeException(FlowRuntimeException exception) : base("Unhandled exception during operation execution! Missing exception event handler or causality.", exception.InnerException, exception.Context)
 {
 }