Replace bare except

... to ensure the logic works only valid exceptions.
This commit is contained in:
Takashi Kajinami 2025-06-09 21:33:57 +09:00
parent 4aa05c7499
commit 21ed8747e2
2 changed files with 3 additions and 5 deletions

View File

@ -108,7 +108,5 @@ class WebsockifySysLogHandler(handlers.SysLogHandler):
else:
self.socket.sendall(msg)
except (KeyboardInterrupt, SystemExit):
raise
except:
except Exception:
self.handleError(record)

View File

@ -157,10 +157,10 @@ class JWTTokenApi(BasePlugin):
try:
key.import_from_pem(key_data)
except:
except Exception:
try:
key.import_key(k=key_data.decode('utf-8'), kty='oct')
except:
except Exception:
logger.error('Failed to correctly parse key data!')
return None