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

Do not blow up if no network is available #18

Closed
mgxd opened this issue Jul 11, 2022 · 0 comments · Fixed by #19
Closed

Do not blow up if no network is available #18

mgxd opened this issue Jul 11, 2022 · 0 comments · Fixed by #19
Labels
bug Something isn't working

Comments

@mgxd
Copy link
Collaborator

mgxd commented Jul 11, 2022

In cases where we simulate no network connection, we should fail gracefully (and silently)

File "/opt/conda/bin/nibabies", line 8, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.9/site-packages/nibabies/cli/run.py", line 28, in main
    ping_migas()
  File "/opt/conda/lib/python3.9/site-packages/nibabies/utils/misc.py", line 135, in ping_migas
    res = migas.add_project(
  File "/opt/conda/lib/python3.9/site-packages/migas/config.py", line 44, in can_send
    return func(*args, **kwargs)
  File "/opt/conda/lib/python3.9/site-packages/migas/operations.py", line 135, in add_project
    _, response = request(Config.endpoint, query)
  File "/opt/conda/lib/python3.9/site-packages/migas/request.py", line 34, in request
    conn.request("POST", purl.path, body, headers)
  File "/opt/conda/lib/python3.9/http/client.py", line 1285, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/opt/conda/lib/python3.9/http/client.py", line 1331, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/opt/conda/lib/python3.9/http/client.py", line 1280, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/opt/conda/lib/python3.9/http/client.py", line 1040, in _send_output
    self.send(msg)
  File "/opt/conda/lib/python3.9/http/client.py", line 980, in send
    self.connect()
  File "/opt/conda/lib/python3.9/http/client.py", line 1447, in connect
    super().connect()
  File "/opt/conda/lib/python3.9/http/client.py", line 946, in connect
    self.sock = self._create_connection(
  File "/opt/conda/lib/python3.9/socket.py", line 823, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/opt/conda/lib/python3.9/socket.py", line 954, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution
@mgxd mgxd added the bug Something isn't working label Jul 11, 2022
@mgxd mgxd closed this as completed in #19 Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant