2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

better except

This commit is contained in:
Nils 2018-03-29 08:41:32 +02:00
parent d809d138b1
commit 727fc7180d

View File

@ -90,13 +90,13 @@ except ValueError:
try:
worker = mining_stats['data']
except:
except (KeyError, TypeError):
print("JSON result error!", file=sys.stderr)
sys.exit(9)
try:
hash_rate = worker['currentHashrate']
except:
except (KeyError, TypeError):
print("No current Hashrate!", file=sys.stderr)
sys.exit(9)