comparison Implab/AbstractPromise.cs @ 199:43b1017ce100 v2

Слияние с default
author cin
date Fri, 14 Oct 2016 03:33:17 +0300
parents 86187b01c4e0
children cbe10ac0731e
comparison
equal deleted inserted replaced
195:ea485487a424 199:43b1017ce100
25 25
26 public void SignalSuccess() { 26 public void SignalSuccess() {
27 if ((m_mask & PromiseEventType.Success) != 0 && m_handler != null) { 27 if ((m_mask & PromiseEventType.Success) != 0 && m_handler != null) {
28 try { 28 try {
29 m_handler(); 29 m_handler();
30 } catch (Exception err) { 30 // Analysis disable once EmptyGeneralCatchClause
31 // avoid calling handler twice in case of error 31 } catch {
32 if (m_error != null)
33 SignalError(err);
34 } 32 }
35 } 33 }
36 } 34 }
37 35
38 public void SignalError(Exception err) { 36 public void SignalError(Exception err) {
53 51
54 public void SignalCancel(Exception reason) { 52 public void SignalCancel(Exception reason) {
55 if (m_cancel != null) { 53 if (m_cancel != null) {
56 try { 54 try {
57 m_cancel(reason); 55 m_cancel(reason);
58 } catch (Exception err) { 56 // Analysis disable once EmptyGeneralCatchClause
59 SignalError(err); 57 } catch {
60 } 58 }
61 } else if ( (m_mask & PromiseEventType.Cancelled) != 0 && m_handler != null) { 59 } else if ( (m_mask & PromiseEventType.Cancelled) != 0 && m_handler != null) {
62 try { 60 try {
63 m_handler(); 61 m_handler();
64 // Analysis disable once EmptyGeneralCatchClause 62 // Analysis disable once EmptyGeneralCatchClause