mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-16 17:47:23 +01:00
Fixed TRY003 (raise-vanilla-args): Avoid specifying long messages outside the exception class
This commit is contained in:
@@ -192,7 +192,9 @@ def get_passphrase(env):
|
||||
backup_root = os.path.join(env["STORAGE_ROOT"], 'backup')
|
||||
with open(os.path.join(backup_root, 'secret_key.txt'), encoding="utf-8") as f:
|
||||
passphrase = f.readline().strip()
|
||||
if len(passphrase) < 43: raise Exception("secret_key.txt's first line is too short!")
|
||||
if len(passphrase) < 43:
|
||||
msg = "secret_key.txt's first line is too short!"
|
||||
raise Exception(msg)
|
||||
|
||||
return passphrase
|
||||
|
||||
|
||||
Reference in New Issue
Block a user