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

grid_download download error handling #16

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

tflores
Copy link

@tflores tflores commented Oct 15, 2023

Em complemento à issue #15 que abri.

Incluí tratamento caso o donwload do grid esteja indisponível, conforme documentado na issue. O tratamento consiste no "else" do bloco de código copiado abaixo:

  if req.status_code == 200:
      with open(join(outdir, filename), "wb") as f:
          for chunk in req.iter_content(chunk_size=1024):
              if chunk:
                  f.write(chunk)
  else:
      raise ValueError("Download unavailable")

Código original: src/cbers4asat/tools/grid.py

@gabriel-russo
Copy link
Owner

Muito obrigado pela sua contribuição!

@gabriel-russo gabriel-russo merged commit 6f424d8 into gabriel-russo:master Oct 16, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants