##// END OF EJS Templates
fixed: the error handler should not handle handlers errors
cin -
r197:86187b01c4e0 default
parent child
Show More
@@ -27,10 +27,8 namespace Implab {
27 27 if ((m_mask & PromiseEventType.Success) != 0 && m_handler != null) {
28 28 try {
29 29 m_handler();
30 } catch (Exception err) {
31 // avoid calling handler twice in case of error
32 if (m_error != null)
33 SignalError(err);
30 // Analysis disable once EmptyGeneralCatchClause
31 } catch {
34 32 }
35 33 }
36 34 }
@@ -55,8 +53,8 namespace Implab {
55 53 if (m_cancel != null) {
56 54 try {
57 55 m_cancel(reason);
58 } catch (Exception err) {
59 SignalError(err);
56 // Analysis disable once EmptyGeneralCatchClause
57 } catch {
60 58 }
61 59 } else if ( (m_mask & PromiseEventType.Cancelled) != 0 && m_handler != null) {
62 60 try {
@@ -39,16 +39,14 namespace Implab {
39 39 if (m_success != null) {
40 40 try {
41 41 m_success(result);
42 } catch(Exception err) {
43 SignalError(err);
42 // Analysis disable once EmptyGeneralCatchClause
43 } catch {
44 44 }
45 45 } else if ((m_mask & PromiseEventType.Success) != 0 && m_handler != null) {
46 46 try {
47 47 m_handler();
48 } catch(Exception err) {
49 // avoid calling handler twice in case of error
50 if (m_error != null)
51 SignalError(err);
48 // Analysis disable once EmptyGeneralCatchClause
49 } catch {
52 50 }
53 51 }
54 52 }
@@ -73,8 +71,8 namespace Implab {
73 71 if (m_cancel != null) {
74 72 try {
75 73 m_cancel(reason);
76 } catch (Exception err) {
77 SignalError(err);
74 // Analysis disable once EmptyGeneralCatchClause
75 } catch {
78 76 }
79 77 } else if ((m_mask & PromiseEventType.Cancelled) != 0 && m_handler != null) {
80 78 try {
General Comments 0
You need to be logged in to leave comments. Login now