1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 15:57:14 +03:00

monitor: Catch any failure to coerce gameversion

Also, log either the error or the success.  That will aid us in diagnosing
any future issues.
This commit is contained in:
Athanasius 2022-11-27 13:02:54 +00:00
parent 8a58220a66
commit b3eff6ab32
No known key found for this signature in database
GPG Key ID: 772697E181BB2767

View File

@ -1686,7 +1686,20 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
self.state['GameVersion'] = entry['gameversion']
self.state['GameBuild'] = entry['build']
self.version = self.state['GameVersion']
self.version_semantic = semantic_version.Version.coerce(self.state['GameVersion'])
try:
self.version_semantic = semantic_version.Version.coerce(self.state['GameVersion'])
except Exception:
# Catching all Exceptions as this is *one* call, and we won't
# get caught out by any semantic_version changes.
self.version_semantic = None
logger.error(f"Couldn't coerce {self.state['GameVersion']=}")
pass
else:
logger.info(f"Parsed {self.state['GameVersion']=} into {self.version_semantic=}")
self.is_beta = any(v in self.version.lower() for v in ('alpha', 'beta')) # type: ignore
except KeyError:
if not suppress: