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

Improve user choice in handling exceptions with more handlers #1618

Closed
dbwiddis opened this issue Apr 27, 2021 · 1 comment
Closed

Improve user choice in handling exceptions with more handlers #1618

dbwiddis opened this issue Apr 27, 2021 · 1 comment
Labels
design discussion Ways to improve OSHI's design new feature Something OSHI doesn't do now but could do PR welcome Not maintainer's priority to do but will accept contributions! up for grabs Issues the maintainers want community help with

Comments

@dbwiddis
Copy link
Member

dbwiddis commented Apr 27, 2021

We've had lengthy discussions on handling exception behavior, for example this discussion: oshi/oshi6#2 also related to requests by @rnaval in #1341 and @joshiste in #1589.

I've deferred most of these conversations to the possibility that in some future version we may completely change the API introducing Optional or wrapper objects with more info, but the longer we go the less I think that's a good direction. I do think there's something we can do within the current API, however and that's to expand the usage of designed-for-extension handler objects.

For example, the WmiQueryHandler class is designed for users to be able to override some behavior (e.g., COM initialization if they have done so in their own app). It also includes a handleComException() method called from within a catch block that by default logs (at WARN level) the exception, but a user could change that behavior if they chose; perhaps a different level of logging, or re-throwing the exception.

I'd like the community's help in identifying good candidates (like #1589) to to add handlers for, as well as suggestions/ideas on best practices so we do it right the first time.

@dbwiddis dbwiddis added new feature Something OSHI doesn't do now but could do up for grabs Issues the maintainers want community help with PR welcome Not maintainer's priority to do but will accept contributions! design discussion Ways to improve OSHI's design labels Apr 27, 2021
@dbwiddis
Copy link
Member Author

Will be incorporated in #1694

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design discussion Ways to improve OSHI's design new feature Something OSHI doesn't do now but could do PR welcome Not maintainer's priority to do but will accept contributions! up for grabs Issues the maintainers want community help with
Projects
None yet
Development

No branches or pull requests

1 participant