Mercurial > pub > ImplabNet
comparison Implab/FuncTaskBase.cs @ 196:40d7fed4a09e
fixed promise chaining behavior, the error handler doesn't handle result or cancellation handlers exceptions these exceptions are propagated to the next handlers.
author | cin |
---|---|
date | Mon, 29 Aug 2016 23:15:51 +0300 |
parents | dd4a3590f9c6 |
children |
comparison
equal
deleted
inserted
replaced
193:0d69c0d6de0d | 196:40d7fed4a09e |
---|---|
38 protected void HandleCancelInternal(Exception reason) { | 38 protected void HandleCancelInternal(Exception reason) { |
39 if (m_cancel != null) { | 39 if (m_cancel != null) { |
40 try { | 40 try { |
41 SetResult(m_cancel(reason)); | 41 SetResult(m_cancel(reason)); |
42 } catch (Exception err) { | 42 } catch (Exception err) { |
43 HandleErrorInternal(err); | 43 SetErrorInternal(err); |
44 } | 44 } |
45 } else { | 45 } else { |
46 HandleErrorInternal(reason ?? new OperationCanceledException()); | 46 SetCancelledInternal(reason); |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 } | 50 } |
51 } | 51 } |