Skip to content

ZipDownload doesn't unwrap exceptions properly #95

@Arthri

Description

@Arthri

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions