nutdotnet / WinNUT-Client

WinForms-based client for monitoring your Uninterruptible Power Supply (UPS) connected to a Network UPS Tools (NUT) server.
GNU General Public License v3.0
209 stars 19 forks source link

Stop substituting default/fallback values for UPS variables #116

Open gbakeman opened 11 months ago

gbakeman commented 11 months ago

The WinNUT variable update system has a design that causes it to substitute in default/fallback values for when there's an error retrieving a variable. This is a problem because the user may be unaware of when a variable is being substituted, and when it is a true value.

Examples

Solution

First, the concept of having fallback values should be removed. When an error is encountered retrieving a variable, that error (exception) should be passed along to the calling method. It will be up to the variables management system to handle errors. Most likely, an error will occur due to a variable not being available on the NUT server. In which case, the variable should be marked so that WinNUT knows how to handle it, and the variable is no longer fetched during periodic update calls.

Items

Related