Skip to content

Commit

Permalink
Fix bridge restore
Browse files Browse the repository at this point in the history
  • Loading branch information
greeeen-dev committed Feb 10, 2025
1 parent 6a86f05 commit 1ff5976
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cogs/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,11 +1135,14 @@ async def restore(self,filename='bridge.json'):
# noinspection PyUnresolvedReferences
data = cog_storage.load(filename)
except json.JSONDecodeError:
# i could write the exceptions cleaner but i'm not bothered to
secure_load_success = False
except UnicodeDecodeError:
secure_load_success = False
except FileNotFoundError:
secure_load_success = False
except KeyError:
secure_load_success = False
else:
data = jsontools.loads_bytes(compressor.decompress(data, self.__bot.config['zstd_chunk_size']))
if not secure_load_success:
Expand All @@ -1155,6 +1158,8 @@ async def restore(self,filename='bridge.json'):
secure_load_success = False
except FileNotFoundError:
secure_load_success = False
except KeyError:
secure_load_success = False
else:
data = jsontools.loads_bytes(data)
if not secure_load_success:
Expand Down

0 comments on commit 1ff5976

Please sign in to comment.