From 45d136777ddd84417d01fa2987b5530b11a9a98d Mon Sep 17 00:00:00 2001 From: Kye Date: Wed, 12 Jul 2023 22:46:56 -0400 Subject: [PATCH] clean up --- swarms/utils/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/swarms/utils/main.py b/swarms/utils/main.py index da503f8f..1d812fbe 100644 --- a/swarms/utils/main.py +++ b/swarms/utils/main.py @@ -274,7 +274,11 @@ class StaticUploader(AbstractUploader): @staticmethod def from_settings(path: Path, endpoint: str) -> "StaticUploader": - return StaticUploader(os.environ["SERVER"], path, endpoint) + server = os.environ.get("SERVER") + if server is None: + raise EnvironmentError("'SERVER' environment variable is not set.") + return StaticUploader(server, path, endpoint) + def get_url(self, uploaded_path: str) -> str: return f"{self.server}/{uploaded_path}"