मेरे पास निम्न कोड है। और मैं मुख्य धागे को अवरुद्ध किए बिना दौड़ना चाहता हूं।Async.Start में अपवाद कैप्चर करें?
let post() = .....
try
let response = post()
logger.Info(response.ToString())
with
| ex -> logger.Error(ex, "Exception: " + ex.Message)
इसलिए मैंने कोड को निम्नलिखित में बदल दिया। हालांकि, post
में अपवाद को कैसे पकड़ें?
let post = async {
....
return X }
try
let response = post |> Async.StartChild
logger.Info(response.ToString())
with
| ex -> logger.Error(ex, "Exception: " + ex.Message)