Description
Prompted by: netdata/netdata#7024
This module appears to directly raise ValueError
and RuntimeError
under specific circumstances. While both are technically accurate, they necessitate use of overly broad except
clauses when dealing with error handling for the module, which makes it difficult to verify that code using the module is actually correct and can't accidentally hide other errors. The RuntimeError
usage is particularly problematic, as it's very rare in the core language to ever catch a RuntimeError
, so any code that catches one tends to look rather out of place to many people.
I would suggest switching to the same methodology that's used by much of the Python ecosystem of defining local sub-classes of Exception
(or whatever specific error makes sense) and raising those instead of directly raising built-in exception types.