Mercurial > pub > ImplabNet
comparison Implab/FuncTask.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 | eee3e49dd1ff |
comparison
equal
deleted
inserted
replaced
| 193:0d69c0d6de0d | 196:40d7fed4a09e |
|---|---|
| 11 | 11 |
| 12 public void Resolve() { | 12 public void Resolve() { |
| 13 if (m_task != null && LockCancelation()) { | 13 if (m_task != null && LockCancelation()) { |
| 14 try { | 14 try { |
| 15 SetResult(m_task()); | 15 SetResult(m_task()); |
| 16 } catch(OperationCanceledException reason) { | |
| 17 HandleCancelInternal(reason); | |
| 18 } catch(Exception err) { | 16 } catch(Exception err) { |
| 19 HandleErrorInternal(err); | 17 SetErrorInternal(err); |
| 20 } | 18 } |
| 21 } | 19 } |
| 22 } | 20 } |
| 23 } | 21 } |
| 24 } | 22 } |
