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

Update errors are not reported anymore in CheckForUpdateEvent event #365

Closed
zgabi opened this issue Apr 15, 2020 · 6 comments
Closed

Update errors are not reported anymore in CheckForUpdateEvent event #365

zgabi opened this issue Apr 15, 2020 · 6 comments

Comments

@zgabi
Copy link
Contributor

zgabi commented Apr 15, 2020

Before 2020.01.11 the CheckForUpdateEvent was called when there was an error with downloading the update xml with args==null.

In this commit it was changed: 32e01a7

Now it is only called when Error is null and not possible to handle the error manually. The only options is just to show or not to show an error dialog.
We'd like to do different error handling without showing the error dialog.

The "Handling updates manually" section also shows an example for that:

AutoUpdater.CheckForUpdateEvent += AutoUpdaterOnCheckForUpdateEvent;

private void AutoUpdaterOnCheckForUpdateEvent(UpdateInfoEventArgs args)
{
    if (args != null)
    {
        ...
    }
    else
    {
         this is not working anymore
    }
}

I agree not to call this event handler in case of error, but please add another error event. (Or restore the previous behavior.)

@ravibpatel
Copy link
Owner

How you intend to handle the case when args is null? How it can be useful?

@zgabi
Copy link
Contributor Author

zgabi commented Apr 15, 2020

As it is in your example:
https://github.com/ravibpatel/AutoUpdater.NET#handling-updates-manually

Earlier args was null when there was an error.

@ravibpatel
Copy link
Owner

Yes, I get that part but I removed it cause it wasn't giving any error info besides setting args to null. Can you tell me what you intend to do in the if (args != null) block of your event?

@zgabi
Copy link
Contributor Author

zgabi commented Apr 15, 2020

It is almost the same as in your example:

                if (args.IsUpdateAvailable)
                {
                    if (args.Mandatory.Value)
                    {
                        if (AutoUpdater.DownloadUpdate(args))
                            Shutdown();
                        else
                            Messaging.ShowInfo(_message_FailedToDownloadUpdate);
                    }
                    else
                    {
                        var result = Messaging.ShowDialog(string.Format(_message_NewVersionAvalilableQuestion, AutoUpdater.AppTitle));

                        if (result == MessageBoxResult.Yes)
                        {
                            if (AutoUpdater.DownloadUpdate(args))
                                Shutdown();
                            else
                                Messaging.ShowInfo(_message_FailedToDownloadUpdate);
                        }
                    }
                }

The difference is in the args==null... i don't want to show any messagebox, just log the problem.

@zgabi
Copy link
Contributor Author

zgabi commented Apr 15, 2020

it wasn't giving any error info besides setting args to null

Yes, that it is true.. this is why I wrote:

I agree not to call this event handler in case of error, but please add another error event.

Since now it is not possible to detect the problem. Earlier at least it was called with null.

@ravibpatel
Copy link
Owner

@zgabi Thanks for the explanation. I understand you want to log the error. I'll see what I can do about it.

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

2 participants