From bc187813e0e589b206fc43405da17ac0f5dfc577 Mon Sep 17 00:00:00 2001 From: Matt Fisher <3608264+mfisher87@users.noreply.github.com> Date: Mon, 10 Feb 2025 16:04:10 -0700 Subject: [PATCH] Raise LoginStrategyUnavailable when hostname not found in netrc --- earthaccess/auth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/earthaccess/auth.py b/earthaccess/auth.py index a24b55b3..216a6523 100644 --- a/earthaccess/auth.py +++ b/earthaccess/auth.py @@ -275,7 +275,9 @@ def _netrc( creds = my_netrc[self.system.edl_hostname] if creds is None: - return False + raise LoginStrategyUnavailable( + f"Earthdata Login hostname {self.system.edl_hostname} not found in .netrc file {netrc_loc}" + ) username = creds["login"] password = creds["password"]