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:
parent
d809d138b1
commit
727fc7180d
@ -90,13 +90,13 @@ except ValueError:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
worker = mining_stats['data']
|
worker = mining_stats['data']
|
||||||
except:
|
except (KeyError, TypeError):
|
||||||
print("JSON result error!", file=sys.stderr)
|
print("JSON result error!", file=sys.stderr)
|
||||||
sys.exit(9)
|
sys.exit(9)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
hash_rate = worker['currentHashrate']
|
hash_rate = worker['currentHashrate']
|
||||||
except:
|
except (KeyError, TypeError):
|
||||||
print("No current Hashrate!", file=sys.stderr)
|
print("No current Hashrate!", file=sys.stderr)
|
||||||
sys.exit(9)
|
sys.exit(9)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user