Note: The default ITS GitLab runner is a shared resource and is subject to slowdowns during heavy usage.
You can run your own GitLab runner that is dedicated just to your group if you need to avoid processing delays.

Verified Commit 6c1b90db authored by Qusai Al Shidi's avatar Qusai Al Shidi 💬
Browse files

FEAT: Add helpful `download_adapt_magnetogram()` error.

download_adapt_magnetogram() now gives a more helpful error message by
showing you what hours have files instead of just telling you file not
found.
parent fbd63523
...@@ -496,8 +496,13 @@ def download_magnetogram_adapt(time, map_type='fixed', **kwargs): ...@@ -496,8 +496,13 @@ def download_magnetogram_adapt(time, map_type='fixed', **kwargs):
filenames = ftp.nlst(file_pattern) filenames = ftp.nlst(file_pattern)
if len(filenames) < 1: if len(filenames) < 1:
raise FileNotFoundError('Could not find a file that matches' daily_filenames = ftp.nlst(file_pattern[:-3] + '*')
+ 'the pattern.') raise FileNotFoundError('FILE NOT FOUND',
'Could not find a file that matches the hour',
'Time entered: ' + str(time)
+ '. Files found from same day:',
*[fname[18:30] for fname in daily_filenames],
)
directory = kwargs.get('download_dir', './') directory = kwargs.get('download_dir', './')
if directory[-1] != '/': if directory[-1] != '/':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment