c
This commit is contained in:
+7
-1
@@ -22,8 +22,14 @@ def read_env_value(key: str, default: str = "") -> str:
|
||||
line = line.strip()
|
||||
if line.startswith(f"{key}="):
|
||||
return line.split("=", 1)[1].strip().strip('"')
|
||||
except Exception:
|
||||
except FileNotFoundError:
|
||||
# appfactory.env nemusí existovat (např. lokální vývoj) – očekávaný stav, vrátíme default.
|
||||
pass
|
||||
except Exception as exc:
|
||||
# Neočekávaná chyba čtení configu – nesmí být tichá.
|
||||
from app.logging_config import get_logger
|
||||
|
||||
get_logger(__name__).warning("Čtení %s (klíč %s) selhalo: %s", APPFACTORY_ENV, key, exc)
|
||||
|
||||
return default
|
||||
|
||||
|
||||
Reference in New Issue
Block a user