(fix) proxy raise exception when config path does not exist

This commit is contained in:
ishaan-jaff 2023-11-11 12:36:22 -08:00
parent b74b051385
commit 833c38edeb

View file

@ -205,12 +205,10 @@ def load_router_config(router: Optional[litellm.Router], config_file_path: str):
with open(config_file_path, 'r') as file: with open(config_file_path, 'r') as file:
config = yaml.safe_load(file) config = yaml.safe_load(file)
else: else:
pass raise Exception(f"Path to config does not exist, 'os.path.exists({config_file_path})' returned False")
except Exception as e: except Exception as e:
raise Exception(f"Exception while reading Config: {e}") raise Exception(f"Exception while reading Config: {e}")
pass
print_verbose(f"Configs passed in, loaded config YAML\n{config}") print_verbose(f"Configs passed in, loaded config YAML\n{config}")
## LITELLM MODULE SETTINGS (e.g. litellm.drop_params=True,..) ## LITELLM MODULE SETTINGS (e.g. litellm.drop_params=True,..)
litellm_settings = config.get('litellm_settings', None) litellm_settings = config.get('litellm_settings', None)