diff options
| author | Ben Sima <ben@bsima.me> | 2025-09-04 16:23:17 -0400 |
|---|---|---|
| committer | Ben Sima <ben@bsima.me> | 2025-09-04 16:23:17 -0400 |
| commit | 91750395b5047dfb99f5d9b7b49d336b2bfb38e8 (patch) | |
| tree | e3915b25abd67c22f037bc9b29bfbd7cbd352438 /Omni | |
| parent | 2a2ff0749f18670ab82c304c8c3468aeea47846f (diff) | |
Refactor Admin and Database path stuff
Moved the Admin related stuff to a separate file. Removed the
repetitive
`db_path` arg everywhere and replaced it with correct assumptions,
similar to
whats in other apps.
Diffstat (limited to 'Omni')
| -rw-r--r-- | Omni/App.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Omni/App.py b/Omni/App.py index 0c6776c..d42bb75 100644 --- a/Omni/App.py +++ b/Omni/App.py @@ -4,6 +4,10 @@ import enum import os +class AreaError(Exception): + """Error raised when area configuration is invalid or missing.""" + + class Area(enum.Enum): """The area we are running.""" @@ -15,7 +19,7 @@ def from_env() -> Area: """Load AREA from environment variable. Raises: - ValueError: if AREA is not defined + AreaError: if AREA is not defined """ var = os.getenv("AREA", "Test") if var == "Test": @@ -23,4 +27,4 @@ def from_env() -> Area: if var == "Live": return Area.Live msg = "AREA not defined" - raise ValueError(msg) + raise AreaError(msg) |
