# HG changeset patch # User cin # Date 2016-09-01 07:43:31 # Node ID 86187b01c4e0351502b97624dce3b57bafe6856e # Parent 40d7fed4a09eea66f914d5407ad4d0b7956ca6b9 fixed: the error handler should not handle handlers errors diff --git a/Implab/AbstractPromise.cs b/Implab/AbstractPromise.cs --- a/Implab/AbstractPromise.cs +++ b/Implab/AbstractPromise.cs @@ -27,10 +27,8 @@ namespace Implab { 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 @@ namespace Implab { 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 { diff --git a/Implab/AbstractPromiseT.cs b/Implab/AbstractPromiseT.cs --- a/Implab/AbstractPromiseT.cs +++ b/Implab/AbstractPromiseT.cs @@ -39,16 +39,14 @@ namespace Implab { 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 @@ namespace Implab { 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 {