comparison Implab/ActionTaskT.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
10 public void Resolve(T value) { 10 public void Resolve(T value) {
11 if (m_task != null && LockCancelation()) { 11 if (m_task != null && LockCancelation()) {
12 try { 12 try {
13 m_task(value); 13 m_task(value);
14 SetResult(); 14 SetResult();
15 } catch(OperationCanceledException reason) {
16 HandleCancelInternal(reason);
17 } catch(Exception err) { 15 } catch(Exception err) {
18 HandleErrorInternal(err); 16 SetErrorInternal(err);
19 } 17 }
20 } 18 }
21 } 19 }
22 } 20 }
23 } 21 }