AutoUpdater.NET icon indicating copy to clipboard operation
AutoUpdater.NET copied to clipboard

Event when failed to get updater config

Open robertnisipeanu opened this issue 5 years ago • 2 comments

Having ReportErrors set to true there will be an error shown if the app fails to read the config file (either because the website where it is hosted is down, either because it returns a 404 not found or any other error, or fails to parse). However, when turning ReportErrors off, there is no way to get if an error has happened (so you can show custom error message). We can do that with the .zip containing new files (by checking if args == null inside the callback), but we can't do that with the config file.

robertnisipeanu avatar May 25 '20 16:05 robertnisipeanu

It is by design cause sometimes devs use this on App startup and they don't want to show error message for that but if user checks for an update via button then it is a good idea to show the error. That's why the ReportErrors option is present.

ravibpatel avatar Jul 27 '20 15:07 ravibpatel

@ravibpatel Thanks for the great works!

I have same issue, that's I'd like to log some of errors internally inside autoupdater to diagnose the issue by myself, instead of just showing these message directly to end user which may not fully understand what happened.

I am wondering, if it's possible to add Log event hander to the autoupdater which can tell what happened inside the autoupdater to help developer diagnose the issue eg:

  • why xml specified and version are higher than my local executable, but not get update notification; may be user clicked ignore.
  • why can't update, may be checksum are not same: https://github.com/ravibpatel/AutoUpdater.NET/issues/413
  • how I can put these updating message info log files.

From library user point of view, it somehow like

AutoUpdater.Log = (logType, message) => { Console.WriteLine($"{logType}:{message}"); }
//OR
AutoUpdater.Log += LogHandler;
private void LogHandler(string logType string message)
{
   //log message here
} 

The AutoUpdater.Log is delegate or event handler which receive the log type alongside with log message. The Log is not only for the error message but also with trace, info, debug message.

imzjy avatar Oct 18 '20 01:10 imzjy