Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Set exception on TCS so it is thrown in correct place #1636

Merged
merged 1 commit into from
Aug 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,14 @@ public async Task<AuthorizationResult> AcquireAuthorizationAsync(Uri authorizati
{
var sendAuthorizeRequestWithTcs = new Action<object>((t) =>
{
authorizationResult = Authenticate(authorizationUri, redirectUri);
((TaskCompletionSource<object>)t).TrySetResult(null);
try
{
authorizationResult = Authenticate(authorizationUri, redirectUri);
((TaskCompletionSource<object>)t).TrySetResult(null);
}catch(Exception e)
{
((TaskCompletionSource<object>)t).TrySetException(e);
}
});

// The Post is needed here to ensure that the Authenticate() execution is posted to the message queue
Expand Down