Check-in [d8049380d5]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Simplified(?) handling of aggregate exceptions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | develop
Files: files | file ages | folders
SHA1: d8049380d548ec728ad6ac73188cd3a0a45b70c3
User & Date: tinus 2018-03-21 21:51:30
Context
2018-03-22
20:36
If the /home parameter is not an existing directory, continue looking at the other possibilities. check-in: e4d5f7bb08 user: tinus tags: develop
2018-03-21
21:51
Simplified(?) handling of aggregate exceptions. check-in: d8049380d5 user: tinus tags: develop
21:42
If a file name is passed, that is interpreted as a zip file; the updater will attempt to update ZTreeWin from that file. check-in: 52618a78f2 user: tinus tags: develop
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ZTUpdater/Program.cs.

77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98







99
100
101
102
103
104
105
106
                    var UpdateTask = Updater.UpdateAsync();
                    UpdateTask.Wait();
                    FilesUpdated = UpdateTask.Result;
                }
                WriteLog(MinimumLevel)($"{FilesUpdated} files updated.", TraceLevel.Info);
                return FilesUpdated > 0 ? 0 : 1;
            }
            catch (AggregateException aex)
            {
                var BackupColor = Console.ForegroundColor;
                Console.ForegroundColor = ConsoleColor.Magenta;
                aex.Handle((ex) => {
                    Console.Error.WriteLine(ex.Message);
                    return true;
                });
                Console.ForegroundColor = BackupColor;
                return 255;
            }
            catch (Exception ex)
            {
                var BackupColor = Console.ForegroundColor;
                Console.ForegroundColor = ConsoleColor.Magenta;







                Console.Error.WriteLine(ex.Message);
                Console.ForegroundColor = BackupColor;
                return 255;
            }
        }

        private static void ShowHelp()
        {







<
<
<
<
<
<
<
<
<
<
<




>
>
>
>
>
>
>
|







77
78
79
80
81
82
83











84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
                    var UpdateTask = Updater.UpdateAsync();
                    UpdateTask.Wait();
                    FilesUpdated = UpdateTask.Result;
                }
                WriteLog(MinimumLevel)($"{FilesUpdated} files updated.", TraceLevel.Info);
                return FilesUpdated > 0 ? 0 : 1;
            }











            catch (Exception ex)
            {
                var BackupColor = Console.ForegroundColor;
                Console.ForegroundColor = ConsoleColor.Magenta;
                if (ex is AggregateException)
                    ((AggregateException)ex).Handle((iex) =>
                    {
                        Console.Error.WriteLine(iex.Message);
                        return true;
                    });
                else
                    Console.Error.WriteLine(ex.Message);
                Console.ForegroundColor = BackupColor;
                return 255;
            }
        }

        private static void ShowHelp()
        {