Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ContinueWith debug log in webapi #847

Merged
merged 1 commit into from
May 15, 2020
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
19 changes: 1 addition & 18 deletions SteamKit2/SteamKit2/Steam/WebAPI/WebAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,24 +210,7 @@ internal AsyncInterface( HttpClient httpClient, string iface, string apiKey )
/// <exception cref="HttpRequestException">An network error occurred when performing the request.</exception>
/// <exception cref="WebAPIRequestException">A network error occurred when performing the request.</exception>
/// <exception cref="InvalidDataException">An error occured when parsing the response from the WebAPI.</exception>
public Task<KeyValue> CallAsync( HttpMethod method, string func, int version = 1, Dictionary<string, object>? args = null )
{
var task = CallAsyncCore( method, func, version, args );

task.ContinueWith( t =>
{
// we need to observe the exception in this OnlyOnFaulted continuation if our task throws an exception but we're not able to observe it
// (such as when waiting for the task times out, and an exception is thrown later)
// see: http://msdn.microsoft.com/en-us/library/dd997415.aspx

DebugLog.WriteLine("WebAPI", "Threw an unobserved exception: {0}", t.Exception);

}, TaskContinuationOptions.OnlyOnFaulted );

return task;
}

async Task<KeyValue> CallAsyncCore( HttpMethod method, string func, int version = 1, Dictionary<string, object>? args = null )
public async Task<KeyValue> CallAsync( HttpMethod method, string func, int version = 1, Dictionary<string, object>? args = null )
{
if ( method == null )
{
Expand Down