suplemon
suplemon copied to clipboard
Except statement should be narrower (catch exactly what is expected)
Maybe the top level exception handling could redirect to the logger but the low level stuff should not be that broad.
It's broad in some places intentionally, but there's probably many that don't need to be. Could you provide some specific examples?
A very quick search, so probably not the best example but simply in the cli module,
try:
import argparse
except:
# Python < 2.7
argparse = False
should be catching ImportError, no reason to catch broader. I'll do a systematic search and a pull request on dev as soon as I have some free time.
Ok! I did a quick search too and found lots of "catch all" except statements. I'll also try to fix them slowly but surely while I work on other things.