Standard Exception logging subroutine, variable error handling, misc. bugfixes #131
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Upgrade logging
There's some more room for improvement in how logs are created.
LogException
subroutine - standard method for logging Exceptions.UPS_Device.Retrieve_UPS_Datas
to use this subroutine for general exceptions.Miscellaneous bugfixes
System.OverflowException
User reports an
OverflowException
was occurring where theUPS_BattCh
double variable is cast to an Integer. It's not used for anything, so I'm removing it in the hopes that this will solve the issue.43ac206
System.NullReferenceException
In addition, the user found another bug where the View and Delete log controls were enabled (logging option enabled) while the log file was not present. More protections have been added to prevent this problem.
da13d50
System.OverflowException
and default valuesSimilar to the first report, another OverflowException is reported having to do with processing of UPS variables. It seems like this user's NUT server is reporting mostly out-of-range values for its variables.