निरंतर श्रृंखलाओं में अपवादों का प्रचार करने का उचित तरीका क्या है?निरंतर श्रृंखलाओं में अपवादों को प्रसारित करने का उचित तरीका क्या है?
t.ContinueWith(t2 =>
{
if(t2.Exception != null)
throw t2.Exception;
/* Other async code. */
})
.ContinueWith(/*...*/);
t.ContinueWith(t2 =>
{
if(t2.IsFaulted)
throw t2.Exception;
/* Other async code. */
})
.ContinueWith(/*...*/);
t.ContinueWith(t2 =>
{
if(t2.Exception != null)
return t2;
/* Other async code. */
})
.ContinueWith(/*...*/);
t.ContinueWith(t2 =>
{
if(t2.IsFaulted)
return t2;
/* Other async code. */
})
.ContinueWith(/*...*/);
t.ContinueWith(t2 =>
{
t2.Wait();
/* Other async code. */
})
.ContinueWith(/*...*/);
t.ContinueWith(t2 =>
{
/* Other async code. */
}, TaskContinuationOptions.NotOnFaulted) // Don't think this one works as expected
.ContinueWith(/*...*/);
मुझे लगता है कि यह सोचते कर रहा हूँ बजाय 't.ContinueWith की (टी = > ...) 'आप वास्तव में मतलब है टी। कंटिन्यूथ (टी 2 => ...)', है ना? – Geoff
@ गीफ: हाँ, यह सही है। – ronag