changeset 197:86187b01c4e0

fixed: the error handler should not handle handlers errors
author cin
date Thu, 01 Sep 2016 10:43:31 +0300
parents 40d7fed4a09e
children b305c678923a 98eeb63cedb2
files Implab/AbstractPromise.cs Implab/AbstractPromiseT.cs
diffstat 2 files changed, 10 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/Implab/AbstractPromise.cs	Mon Aug 29 23:15:51 2016 +0300
+++ b/Implab/AbstractPromise.cs	Thu Sep 01 10:43:31 2016 +0300
@@ -27,10 +27,8 @@
                 if ((m_mask & PromiseEventType.Success) != 0 && m_handler != null) {
                     try {
                         m_handler();
-                    } catch (Exception err) {
-                        // avoid calling handler twice in case of error
-                        if (m_error != null)
-                            SignalError(err);
+                        // Analysis disable once EmptyGeneralCatchClause
+                    } catch {
                     }
                 }
             }
@@ -55,8 +53,8 @@
                 if (m_cancel != null) {
                     try {
                         m_cancel(reason);
-                    } catch (Exception err) {
-                        SignalError(err);
+                        // Analysis disable once EmptyGeneralCatchClause
+                    } catch {
                     }
                 } else if ( (m_mask & PromiseEventType.Cancelled) != 0 && m_handler != null) {
                     try {
--- a/Implab/AbstractPromiseT.cs	Mon Aug 29 23:15:51 2016 +0300
+++ b/Implab/AbstractPromiseT.cs	Thu Sep 01 10:43:31 2016 +0300
@@ -39,16 +39,14 @@
                 if (m_success != null) {
                     try {
                         m_success(result);
-                    } catch(Exception err) {
-                        SignalError(err);
+                        // Analysis disable once EmptyGeneralCatchClause
+                    } catch {
                     }
                 } else if ((m_mask & PromiseEventType.Success) != 0 && m_handler != null) {
                     try {
                         m_handler();
-                    } catch(Exception err) {
-                        // avoid calling handler twice in case of error
-                        if (m_error != null)
-                            SignalError(err);
+                        // Analysis disable once EmptyGeneralCatchClause
+                    } catch {
                     }
                 }
             }
@@ -73,8 +71,8 @@
                 if (m_cancel != null) {
                     try {
                         m_cancel(reason);
-                    } catch (Exception err) {
-                        SignalError(err);
+                        // Analysis disable once EmptyGeneralCatchClause
+                    } catch {
                     }
                 } else if ((m_mask & PromiseEventType.Cancelled) != 0 && m_handler != null) {
                     try {