-
Notifications
You must be signed in to change notification settings - Fork 80
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
fix Timeout - Task Cancelled Exception #184
Conversation
src/Methods.cs
Outdated
@@ -1055,6 +1064,11 @@ public async Task ExportLicenseTexts(List<LibraryInfo> infos) | |||
// handled in !IsSuccessStatusCode, ignoring to continue export | |||
break; | |||
} | |||
catch(TaskCanceledException ex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTTP Client sometimes throws an OperationCanceledException as well. Because TaskCanceledException derives from OperationCanceledException we can catch OperationCanceledException and slightly adjust our log message to handle both exceptions.
catch(TaskCanceledException ex) | |
catch(OperationCanceledException ex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the recommendation. I pushed a new commit.
src/Methods.cs
Outdated
@@ -1055,6 +1064,11 @@ public async Task ExportLicenseTexts(List<LibraryInfo> infos) | |||
// handled in !IsSuccessStatusCode, ignoring to continue export | |||
break; | |||
} | |||
catch(TaskCanceledException ex) | |||
{ | |||
WriteOutput($"Task Cancelled Exception during download of license url {info.LicenseUrl} exception {ex.Message}", logLevel: LogLevel.Verbose); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WriteOutput($"Task Cancelled Exception during download of license url {info.LicenseUrl} exception {ex.Message}", logLevel: LogLevel.Verbose); | |
WriteOutput($"{ex.GetType().Name} during download of license url {info.LicenseUrl} exception {ex.Message}", logLevel: LogLevel.Verbose); |
This PR is related with the following issue:
#182