Replace bare except
... to ensure the logic works only valid exceptions.
This commit is contained in:
parent
4aa05c7499
commit
21ed8747e2
|
|
@ -108,7 +108,5 @@ class WebsockifySysLogHandler(handlers.SysLogHandler):
|
|||
else:
|
||||
self.socket.sendall(msg)
|
||||
|
||||
except (KeyboardInterrupt, SystemExit):
|
||||
raise
|
||||
except:
|
||||
except Exception:
|
||||
self.handleError(record)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue