diff Implab/SuccessPromiseT.cs @ 203:4d9830a9bbb8 v2

Added 'Fail' method to RunnableComponent which allows component to move from Running to Failed state. Added PollingComponent a timer based runnable component More tests Added FailPromise a thin class to wrap exceptions Fixed error handling in SuccessPromise classes.
author cin
date Tue, 18 Oct 2016 17:49:54 +0300
parents 706fccb85524
children cbe10ac0731e
line wrap: on
line diff
--- a/Implab/SuccessPromiseT.cs	Tue Oct 18 01:03:49 2016 +0300
+++ b/Implab/SuccessPromiseT.cs	Tue Oct 18 17:49:54 2016 +0300
@@ -12,14 +12,8 @@
             if (success != null) {
                 try {
                     success(m_value);
-                } catch(Exception err) {
-                    if (error != null) {
-                        try {
-                            error(err);
-                            // Analysis disable once EmptyGeneralCatchClause
-                        } catch {
-                        }
-                    }
+                    // Analysis disable once EmptyGeneralCatchClause
+                } catch {
                 }
             }
             return this;
@@ -29,14 +23,8 @@
             if (success != null) {
                 try {
                     success(m_value);
-                } catch(Exception err) {
-                    if (error != null) {
-                        try {
-                            error(err);
-                            // Analysis disable once EmptyGeneralCatchClause
-                        } catch {
-                        }
-                    }
+                    // Analysis disable once EmptyGeneralCatchClause
+                } catch {
                 }
             }
             return this;
@@ -65,14 +53,8 @@
             if (success != null) {
                 try {
                     success();
-                } catch(Exception err) {
-                    if (error != null) {
-                        try {
-                            error(err);
-                            // Analysis disable once EmptyGeneralCatchClause
-                        } catch {
-                        }
-                    }
+                    // Analysis disable once EmptyGeneralCatchClause
+                } catch {
                 }
             }
             return this;
@@ -82,14 +64,8 @@
             if (success != null) {
                 try {
                     success();
-                } catch(Exception err) {
-                    if (error != null) {
-                        try {
-                            error(err);
-                            // Analysis disable once EmptyGeneralCatchClause
-                        } catch {
-                        }
-                    }
+                    // Analysis disable once EmptyGeneralCatchClause
+                } catch {
                 }
             }
             return this;