|
@@ -79,7 +79,7 @@ class DataPlatformService(Service):
|
|
|
if arrow.get(latest_time, TIME_FMT).shift(minutes=15) < arrow.get(self._now_time, TIME_FMT):
|
|
|
logger.info(f'delayed data - {object_id}: ({latest_time}, {latest_data})')
|
|
|
value = round_half_up(latest_data, 2)
|
|
|
- except (IndexError, KeyError):
|
|
|
+ except (IndexError, KeyError, TypeError):
|
|
|
value = np.NAN
|
|
|
except TypeError:
|
|
|
value = -1.0
|
|
@@ -116,7 +116,7 @@ class DataPlatformService(Service):
|
|
|
}
|
|
|
for item in content
|
|
|
]
|
|
|
- except KeyError:
|
|
|
+ except (KeyError, TypeError, IndexError):
|
|
|
result = []
|
|
|
|
|
|
return result
|
|
@@ -151,7 +151,7 @@ class DataPlatformService(Service):
|
|
|
if arrow.get(latest_time, TIME_FMT).shift(minutes=15) < arrow.get(end_time, TIME_FMT):
|
|
|
logger.info(f'delayed data - {object_id}: ({latest_time}, {latest_data})')
|
|
|
value = round_half_up(latest_data, 2)
|
|
|
- except (KeyError, IndexError):
|
|
|
+ except (KeyError, IndexError, TypeError):
|
|
|
value = np.NAN
|
|
|
except TypeError:
|
|
|
value = -1.0
|
|
@@ -225,7 +225,7 @@ class DataPlatformService(Service):
|
|
|
|
|
|
try:
|
|
|
info = raw_info['Content'][0]['infos'][code]
|
|
|
- except KeyError as e:
|
|
|
+ except (KeyError, IndexError, TypeError) as e:
|
|
|
logger.error(f'id: {object_id}, details: {e}')
|
|
|
info = None
|
|
|
|