セクション 3. 章 6
single
Challenge: Robust Async Error Handling
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
Write a C# console application that demonstrates error handling in async methods.
- Implement the
ThrowingAsyncMethodso that it simulates asynchronous work (such as withTask.Delay) and then throws an exception with the messageError occurred in async method!. - In the
Mainmethod, callThrowingAsyncMethodusingawaitinside a try/catch block. - When the exception is caught, print the exception message to the console using
Console.WriteLine. - Ensure your program can be run and the exception message is displayed correctly when the async method fails.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 3. 章 6
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください