File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -823,14 +823,8 @@ def download_file_from_cddis(
823823 if download_filepath is None :
824824 return None # File exists and user chose not to replace
825825
826- # Get NASA Earthdata credentials
827- try :
828- earthdata_username , earthdata_password = get_earthdata_credentials (
829- username = username , password = password
830- )
831- except ValueError as e :
832- logging .error (f"Failed to obtain NASA Earthdata credentials: { e } " )
833- raise
826+ # Get NASA Earthdata credentials (raises ValueError on failure)
827+ earthdata_username , earthdata_password = get_earthdata_credentials (username = username , password = password )
834828
835829 retries = 0
836830 while retries <= max_retries :
@@ -862,6 +856,7 @@ def download_file_from_cddis(
862856 except _requests .exceptions .RequestException as e :
863857 retries += 1
864858 if retries > max_retries :
859+ # TODO consider wrapping the RequestException with this, and raising that, rather than logging an error
865860 logging .error (f"Failed to download { filename } after { max_retries } retries: { e } " )
866861 if download_filepath .is_file ():
867862 download_filepath .unlink ()
You can’t perform that action at this time.
0 commit comments