Mercurial > pub > ImplabNet
comparison Implab/FuncChainTaskBase.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 |
---|---|
41 try { | 41 try { |
42 var p = m_cancel(reason); | 42 var p = m_cancel(reason); |
43 p.On(SetResult, HandleErrorInternal, SetCancelledInternal); | 43 p.On(SetResult, HandleErrorInternal, SetCancelledInternal); |
44 CancellationRequested(p.Cancel); | 44 CancellationRequested(p.Cancel); |
45 } catch (Exception err) { | 45 } catch (Exception err) { |
46 HandleErrorInternal(err); | 46 SetErrorInternal(err); |
47 } | 47 } |
48 } else { | 48 } else { |
49 HandleErrorInternal(reason ?? new OperationCanceledException()); | 49 SetCancelledInternal(reason); |
50 } | 50 } |
51 } | 51 } |
52 } | 52 } |
53 } | 53 } |
54 | 54 |