diff Implab/AbstractPromiseT.cs @ 197:86187b01c4e0

fixed: the error handler should not handle handlers errors
author cin
date Thu, 01 Sep 2016 10:43:31 +0300
parents 97fbbf816844
children cbe10ac0731e
line wrap: on
line diff
--- 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 {