Open TacoTacoCode opened 5 months ago
Is there a sample code to repro? And suggest to move this issue to dotnet/runtime
https://github.com/dotnet/runtime/issues
Yes, you need Task.FromResult
between return
and new T
.
Something like:
catch (Exception exception)
{
return Task.FromResult(new T
{
Errors = new List<string>()
{
exception.Message
}
});
}
I have below method that throw InvalidCastException when jump into catch block on production. Do i need to do
Task.FromResult
for catch block now? Please help check.NET SDK: Version: 8.0.100 Commit: 57efcf1350 Workload version: 8.0.100-manifests.6c33ef20
Runtime Environment: OS Name: Windows OS Version: 10.0.17763 OS Platform: Windows RID: win-x64
.NET workloads installed: Workload version: 8.0.100-manifests.6c33ef20
Host: Version: 8.0.0 Architecture: x64 Commit: 5535e31a71