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

ZipDownload doesn't unwrap exceptions properly #95

Open
Arthri opened this issue Nov 2, 2022 · 0 comments
Open

ZipDownload doesn't unwrap exceptions properly #95

Arthri opened this issue Nov 2, 2022 · 0 comments

Comments

@Arthri
Copy link
Contributor

Arthri commented Nov 2, 2022

var data = client.GetByteArrayAsync(url).Result;

The above line causes download errors to be swallowed and displayed as "A task was canceled."

Unhandled exception. System.AggregateException: One or more errors occurred. (A task was canceled.)
 ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Threading.Tasks.Task.GetExceptions(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at OTAPI.Patcher.Common.DownloadZip(String url) in \Open-Terraria-API\OTAPI.Patcher\Common.cs:line 73
   at OTAPI.Patcher.Targets.PCServerTarget.DownloadServer() in \Open-Terraria-API\OTAPI.Patcher\Targets\PCServerTarget.cs:line 43
   at OTAPI.Patcher.Targets.PCServerTarget.Patch() in \Open-Terraria-API\OTAPI.Patcher\Targets\PCServerTarget.cs:line 88
   at OTAPI.Patcher.Program.Main(String[] args) in \Open-Terraria-API\OTAPI.Patcher\Program.cs:line 28
--- End of stack trace from previous location ---

   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at OTAPI.Patcher.Common.DownloadZip(String url) in \Open-Terraria-API\OTAPI.Patcher\Common.cs:line 73
   at OTAPI.Patcher.Targets.PCServerTarget.DownloadServer() in \Open-Terraria-API\OTAPI.Patcher\Targets\PCServerTarget.cs:line 43
   at OTAPI.Patcher.Targets.PCServerTarget.Patch() in \Open-Terraria-API\OTAPI.Patcher\Targets\PCServerTarget.cs:line 88
   at OTAPI.Patcher.Program.Main(String[] args) in \Open-Terraria-API\OTAPI.Patcher\Program.cs:line 28

fwiw, my error was a network issue causing timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant