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

Wrap "name of service not known" exception in better exception #28

Open
Grokzen opened this issue Jan 8, 2020 · 0 comments
Open

Wrap "name of service not known" exception in better exception #28

Grokzen opened this issue Jan 8, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@Grokzen
Copy link
Contributor

Grokzen commented Jan 8, 2020

Environment

  • Python version:
  • Phabfive version:

Steps to Reproduce

## When running this

$ phabfive diffusion list inactive

Traceback (most recent call last):
  File "/home/nn/.virtualenvs/phabfive-kOPdHCq0/bin/phabfive", line 11, in <module>
    load_entry_point('phabfive', 'console_scripts', 'phabfive')()
  File "/home/nn/code/phabfive/phabfive/cli.py", line 119, in cli_entrypoint
    run(cli_args, sub_args)
  File "/home/nn/code/phabfive/phabfive/cli.py", line 103, in run
    print(p.print_secret(p.get_secret(sub_args['<id>'])))
  File "/home/nn/code/phabfive/phabfive/passphrase.py", line 33, in get_secret
    response = self.phab.passphrase.query(ids=[ids], needSecrets=1)
  File "/home/nn/.virtualenvs/phabfive-kOPdHCq0/lib/python3.6/site-packages/phabricator/__init__.py", line 248, in __call__
    return self._request(**kwargs)
  File "/home/nn/.virtualenvs/phabfive-kOPdHCq0/lib/python3.6/site-packages/phabricator/__init__.py", line 308, in _request
    conn.request('POST', path, body, headers)
  File "/usr/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/lib/python3.6/http/client.py", line 964, in send
    self.connect()
  File "/usr/lib/python3.6/http/client.py", line 1392, in connect
    super().connect()
  File "/usr/lib/python3.6/http/client.py", line 936, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/lib/python3.6/socket.py", line 704, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

Expected Behavior

A bettter and wrapped exception to be presented to the user.

Observed Behavior

A low level exception was raised to the user

@Grokzen Grokzen added the bug Something isn't working label Jan 9, 2020
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

No branches or pull requests

1 participant