Skip to content

Commit

Permalink
feat: target 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bmazzarol committed Jan 15, 2024
1 parent f537fcb commit 7c2a5b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Icicle/Handles/ResultHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void ThrowIfFaulted(RunToken token)

if (_task is { IsFaulted: true } ft)
{
ExceptionDispatchInfo.Throw(ft.AsTask().Exception!.TryUnwrap());
ExceptionDispatchInfo.Capture(ft.AsTask().Exception!.TryUnwrap()).Throw();
}
}

Expand Down Expand Up @@ -139,8 +139,8 @@ public T Value(RunToken token)
case { IsCompletedSuccessfully: true } st:
return st.Result;
case { IsFaulted: true } ft:
ExceptionDispatchInfo.Throw(ft.AsTask().Exception!.TryUnwrap());
return default; // unreachable
ExceptionDispatchInfo.Capture(ft.AsTask().Exception!.TryUnwrap()).Throw();
return default!; // unreachable
default:
throw new TaskCanceledException();
}
Expand Down Expand Up @@ -185,7 +185,7 @@ public void ThrowIfFaulted(RunToken token)

if (_task is { IsFaulted: true } ft)
{
ExceptionDispatchInfo.Throw(ft.AsTask().Exception!.TryUnwrap());
ExceptionDispatchInfo.Capture(ft.AsTask().Exception!.TryUnwrap()).Throw();
}
}

Expand Down
2 changes: 1 addition & 1 deletion Icicle/Icicle.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
2 changes: 1 addition & 1 deletion Icicle/TaskScope/TaskScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public virtual async ValueTask<RunToken> Run(
IsScopeFaulted = true;
if (runOptions.ThrowOnFault)
{
ExceptionDispatchInfo.Throw(e.TryUnwrap());
ExceptionDispatchInfo.Capture(e.TryUnwrap()).Throw();
}
}
finally
Expand Down

0 comments on commit 7c2a5b8

Please sign in to comment.