1
0

Better logging
Some checks failed
Test Python / Test (push) Failing after 22s

This commit is contained in:
Jon Michael Aanes 2024-07-08 00:02:43 +02:00
parent ecad126d55
commit aca9ddfc02
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA

View File

@ -80,16 +80,16 @@ class SecretLoader:
def load_or_fail(self, env_key: str) -> str:
value = self._load_or_none(env_key)
if value is None:
msg = f'Could not load secret {env_key}'
msg = f'Failed to load secret with key: {env_key}'
raise Exception(msg)
logger.info('Loaded secret: %s', env_key)
logger.info('Loaded secret with key: %s', env_key)
return value
def load(self, env_key: str) -> str | None:
value = self._load_or_none(env_key)
if value is None:
logger.exception('Could not load secret %s', env_key)
logger.info('Loaded secret: %s', env_key)
logger.exception('Failed to load secret with key: %s', env_key)
logger.info('Loaded secret with key: %s', env_key)
return value
def _load_or_none(self, env_key: str) -> str | None: