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();
                                           };
        }
Exemplo n.º 2
0
Arquivo: GUI.cs Projeto: 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)
 {
 }
Exemplo n.º 4
0
 //[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);
 }
Exemplo n.º 5
0
 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);
 }
Exemplo n.º 6
0
 static void Handle_exception(FlowRuntimeException ex)
 {
     Console.WriteLine("*** Exception during file processing: {0}", ex.InnerException);
 }
Exemplo n.º 7
0
 public UnhandledFlowRuntimeException(FlowRuntimeException exception) : base("Unhandled exception during operation execution! Missing exception event handler or causality.", exception.InnerException, exception.Context)
 {
 }