-
Notifications
You must be signed in to change notification settings - Fork 2
Use exceptions to fail clearly, loudly, properly #3
Copy link
Copy link
Open
Description
There is a potential issue in cdmconfighandler.py where an unknown resource type during config parsing leads to an error message in the log, but the function call still finishes and returns. (That it implicitly returns None instead of the expected list then will likely generate an opaque error somewhere further down the call chain.)
Consider instead to use custom Exception subclasses for situations like these. Even if you just fail with an unhandled exception in, well, exceptional cases like these, you can at least use the exception message to communicate what the problem was.
Example:
if rrType == "mx":
# Handle MX records
elif ...:
...
else:
raise UnsupportedRRTypeError("Unsupported RR type '" + str(rrType) + "'")Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels