Repository: PixiEditor/PixiEditor
File: src/PixiEditor/ViewModels/SubViewModels/UpdateViewModel.cs (C#)

Code before:
        if (UpdateState == UpdateState.ReadyToInstall)
        {
            Install(false);
        }
#endif
    }

    public async Task Download()
    {
        bool updateCompatible, updateFileDoesNotExists, updateExeDoesNotExists;
        try
        {
            updateCompatible = await UpdateChecker.IsUpdateCompatible();
            updateFileDoesNotExists = !AutoUpdateFileExists();
            updateExeDoesNotExists = !UpdateInstallerFileExists();
        }
        catch (SocketException ex)
        {
            UpdateState = UpdateState.UnableToCheck;
            return;
        }
        catch (IOException ex)
        {
            UpdateState = UpdateState.UnableToCheck;
            return;
        }
        catch (Exception ex)
        {
            UpdateState = UpdateState.UnableToCheck;
            CrashHelper.SendExceptionInfo(ex);
            return;
        }


        if (!updateExeDoesNotExists || !updateFileDoesNotExists)
        {
            UpdateState = UpdateState.ReadyToInstall;
            return;
        }

        if ((updateFileDoesNotExists && updateExeDoesNotExists))
        {
            try
            {
                UpdateState = UpdateState.Downloading;
                CurrentProgress = 0;
                if (updateCompatible || !IOperatingSystem.Current.IsWindows)
                {
                    await UpdateDownloader.DownloadReleaseZip(UpdateChecker.LatestReleaseInfo, ZipContentType,
                        ZipExtension);
                }

Review comment (suggestion):
You could remove these and just put a type check in the `catch (Exception ...)` one

Code after:
        if (UpdateState == UpdateState.ReadyToInstall)
        {
            Install(false);
        }
#endif
    }

    public async Task Download()
    {
        bool updateCompatible, updateFileDoesNotExists, updateExeDoesNotExists;
        try
        {
            updateCompatible = await UpdateChecker.IsUpdateCompatible();
            updateFileDoesNotExists = !AutoUpdateFileExists();
            updateExeDoesNotExists = !UpdateInstallerFileExists();
        }
        catch (Exception ex)
        {
            UpdateState = UpdateState.UnableToCheck;
            if (ex is not IOException && ex is not SocketException)
            {
                CrashHelper.SendExceptionInfo(ex);
            }

            return;
        }


        if (!updateExeDoesNotExists || !updateFileDoesNotExists)
        {
            UpdateState = UpdateState.ReadyToInstall;
            return;
        }

        if ((updateFileDoesNotExists && updateExeDoesNotExists))
        {
            try
            {
                UpdateState = UpdateState.Downloading;
                CurrentProgress = 0;
                if (updateCompatible || !IOperatingSystem.Current.IsWindows)
                {
                    await UpdateDownloader.DownloadReleaseZip(UpdateChecker.LatestReleaseInfo, ZipContentType,
                        ZipExtension);
                }
                else if (IOperatingSystem.Current.IsWindows)
                {
                    await UpdateDownloader.DownloadInstaller(UpdateChecker.LatestReleaseInfo);
                }

                UpdateState = UpdateState.ReadyToInstall;