KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
What is the proper way to propagate exceptions in continuation chains? 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(/*...*/);
Tags (comma-separated)
Save Edits
Cancel