Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing File Error when GEO is Down #51

Open
Miserlou opened this issue Jan 29, 2019 · 1 comment
Open

Missing File Error when GEO is Down #51

Miserlou opened this issue Jan 29, 2019 · 1 comment

Comments

@Miserlou
Copy link
Contributor

When NCBI/GEO is down, I'd expect a custom exception or some kind of graceful handling, instead you get:

  File "/home/user/data_refinery_foreman/surveyor/geo.py", line 222, in create_experiment_and_samples_from_api
    gse = GEOparse.get_GEO(experiment_accession_code, destdir=self.get_temp_path(), how="brief", silent=True)
  File "/usr/local/lib/python3.5/dist-packages/GEOparse/GEOparse.py", line 84, in get_GEO
    return parse_GSE(filepath)
  File "/usr/local/lib/python3.5/dist-packages/GEOparse/GEOparse.py", line 502, in parse_GSE
    with utils.smart_open(filepath) as soft:
  File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.5/dist-packages/GEOparse/utils.py", line 156, in smart_open
    fh = fopen(filepath, mode, errors="ignore")
  File "/usr/lib/python3.5/gzip.py", line 53, in open
    binary_file = GzipFile(filename, gz_mode, compresslevel)
  File "/usr/lib/python3.5/gzip.py", line 163, in __init__
    fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/1/GSE11915_family.soft.gz'

which looks like it's a local disk error, which it isn't, it's a GEO-is-down-error.

@guma44
Copy link
Owner

guma44 commented Jan 30, 2019

Hi, thanks for pointing this out. I never had this issue but you are right. It should be checked for timeout or any other http error and the exception should tell it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants