gotify-push icon indicating copy to clipboard operation
gotify-push copied to clipboard

Feedback

Open jmattheis opened this issue 6 years ago • 2 comments
trafficstars

Hey! Thanks for creating this project, its really cool to see other contributing to Gotify (:

It would be great, if you could publish this package to pip, that its easier to install. Also the error message when Gotify is not available could be improved (currently a stacktrace is shown).

Overall good work.

jmattheis avatar Nov 18 '18 13:11 jmattheis

Hey, thanks for the feedback! And thanks for creating Gotify. I've been looking for a self-hosted notification service for a long time.

Do you mean the stacktrace when the Gotify server can't be reached? For example if the server is down, if there is no internet connectivity, or when the wrong URL is supplied?

I've never published a package to a package manager, but I'll take a look at how to do so. However, I don't think I'll add it to pip since I don't want to fill the repositories with something so few people will probably use (especially now that you have created an official single binary CLI client).

schwma avatar Nov 26 '18 23:11 schwma

@schwma Thanks, having feedback like this is much more valueable then just a star on GitHub, it really means a lot to me (:

Well I really like the idea on making it available on pip, like this it would be a great alternative to gotify/cli because it's pretty easy to install when python is already installed.

Here's the error message when the gotify/server is not reachable:

root@ubuntu:~/gotify-push# ./gotify-push -m test
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.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 -5] No address associated with hostname

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 852, in _validate_conn
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 284, in connect
    conn = self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f6ed364d438>: Failed to establish a new connection: [Errno -5] No address associated with hostname

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='unknowndomail.asdasdadasdadasdasdas.de', port=443): Max retries exceeded with url: /message?token=Agx6vbehngN2JtK (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f6ed364d438>: Failed to establish a new connection: [Errno -5] No address associated with hostname',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./gotify-push", line 159, in <module>
    main()
  File "./gotify-push", line 31, in main
    resp = doRequest(url, token, title, message, priority)
  File "./gotify-push", line 154, in doRequest
    'priority': priority
  File "/usr/local/lib/python3.6/dist-packages/requests/api.py", line 116, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='unknowndomail.asdasdadasdadasdasdas.de', port=443): Max retries exceeded with url: /message?token=Agx6vbehngN2JtK (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f6ed364d438>: Failed to establish a new connection: [Errno -5] No address associated with hostname',))

jmattheis avatar Nov 29 '18 20:11 jmattheis