Skip to content

Commit 4d61f42

Browse files
authored
Refactor: error/log message (#9297)
* feat: improve error logging * ref: error msg
1 parent cb2128b commit 4d61f42

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Brokerages/Authentication/OAuthTokenHandler.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ public override TokenCredentials GetAccessToken(CancellationToken cancellationTo
8787
}
8888
}
8989

90-
throw new InvalidOperationException(string.Join(",", response.Errors));
90+
Logging.Log.Error($"{nameof(OAuthTokenHandler<TRequest, TResponse>)}.{nameof(GetAccessToken)}: Failed to retrieve access token. Response: {response}. Last known expiration: {_accessTokenMetaData?.Expiration.ToStringInvariant() ?? "Not requested yet"}.");
91+
throw new InvalidOperationException($"Authentication failed. " +
92+
$"Details: {(response?.Errors?.Count > 0 ? string.Join(",", response.Errors) : "empty")}");
9193
}
9294
catch (Exception ex)
9395
{

0 commit comments

Comments
 (0)