mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-21 11:27:38 +03:00
try/except for NavRoute json.load()
This commit is contained in:
parent
0dc7c62fa8
commit
f280a7e863
10
monitor.py
10
monitor.py
@ -671,8 +671,14 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
||||
elif event_type == 'NavRoute':
|
||||
# Added in ED 3.7 - multi-hop route details in NavRoute.json
|
||||
with open(join(self.currentdir, 'NavRoute.json'), 'rb') as rf: # type: ignore
|
||||
entry = json.load(rf)
|
||||
self.state['NavRoute'] = entry
|
||||
try:
|
||||
entry = json.load(rf)
|
||||
|
||||
except json.JSONDecodeError:
|
||||
logger.exception('Failed decoding NavRoute.json')
|
||||
|
||||
else:
|
||||
self.state['NavRoute'] = entry
|
||||
|
||||
elif event_type in ('CollectCargo', 'MarketBuy', 'BuyDrones', 'MiningRefined'):
|
||||
commodity = self.canonicalise(entry['Type'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user