This commit is contained in:
parent
ecad126d55
commit
aca9ddfc02
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user