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

Error Reporting & Exception Catching Refactor #86

Merged
merged 4 commits into from
Aug 2, 2023
Merged

Conversation

gbakeman
Copy link
Contributor

@gbakeman gbakeman commented May 25, 2023

Per #79 and #80:

Another issue like #49 , some thrown exceptions aren't being caught by the bug report generator. More work is needed in that area.

In addition, certain Synology NUT servers allow a client to LOGIN successfully, but will then reply ACCESS-DENIED to a LOGOUT command. I don't think this should be happening, but regardless, we're not catching a protocol exception and allowing it to crash the program. Need to make sure we're handling protocol exceptions appropriately.

Summary of changes

  • More reorganization in WinNUT_Globals.vb. Renaming some variables for clarity.
  • Updated dependencies
  • Refactor error report generation. Attempts to account for more error conditions and ensure a report can be generated.
  • Various improvements to protocol code, focusing on the Login subroutine.
  • Additional small tweaks to error report generation; corrected output formatting and try to standardize times and locale.
  • Additional compatibility with Synology NUT server quirk when the client is not in the allowed clients list (Synology-only feature)

- More reorganization in WinNUT_Globals.vb. Renaming some variables for clarity.
- Updated dependencies
- Refactor error report generation. Attempts to account for more error conditions and ensure a report can be generated.
@gbakeman gbakeman added the bug Something isn't working label May 25, 2023
@gbakeman gbakeman added this to the 2.2 Stable Release milestone May 25, 2023
@gbakeman gbakeman self-assigned this May 25, 2023
@gbakeman gbakeman linked an issue May 25, 2023 that may be closed by this pull request
gbakeman added a commit that referenced this pull request Jul 2, 2023
Improvements to Login subroutine

Closing to merge changes and continue broader efforts towards #79 and #80 per PR #86 .
gbakeman added 2 commits July 2, 2023 14:38
- Added in code so the unhandled exception method can be tested while debugging
- Try to define invariant culture and use it at critical points so crash logs come back in English. Will make providing support easier.
- Unescape newline characters in serialization output
@gbakeman gbakeman changed the title Error Reporting Refactor & Mysterious Crash Error Reporting Refactor & Uncaught ACCESS-DENIED error Jul 3, 2023
@gbakeman gbakeman changed the title Error Reporting Refactor & Uncaught ACCESS-DENIED error Error Reporting & Catching Refactor Jul 4, 2023
@gbakeman gbakeman changed the title Error Reporting & Catching Refactor Error Reporting & Exception Catching Refactor Jul 4, 2023
- General code cleanup throughout files

- Refactored Disconnect subroutine in the Socket class; there is no more "silent" operation, and the SocketDisconnected event is always raised regardless of result. We will also avoid trying to log out when not already logged in.
- Added a ToString function to UPS_Device to give the UPSName property. I'm realizing that depending on a valid instance of Nut_Config for any of the properties to successfully return is fairly problematic, so this may necessitate the need to migrate to Nut.Net.
- Made the Disconnect subroutine in UPS_Device the final stop for handling exceptions generated during the procedure. Any communication is raised as events back to a listening client.
- Removed unused Watchdog subroutine
@gbakeman gbakeman added the enhancement New feature or request label Jul 4, 2023
@gbakeman gbakeman merged commit 3464944 into Dev-2.2 Aug 2, 2023
@gbakeman gbakeman deleted the 79-winnut-crash branch August 2, 2023 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
1 participant