Practice · 2 of 5
Debug: The Wrapped Exception
CHALLENGE
Difficulty: intermediate+25 XP
LoadConfigAsync fails with InvalidOperationException("no config"). GetSetting — the sync entry point — surfaces it wrongly: callers catch InvalidOperationException and never see it. Fix GetSetting so the REAL exception type reaches callers (not AggregateException), while staying synchronous.
``csharp
static Task<string> LoadConfigAsync(); // provided: throws InvalidOperationException
static string GetSetting(); // fix me
``
Press Submit to check your solution.
Back to lesson: Practice: Async Practice: Fetch, Fan-out, Cancel