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

friendly error messages if update fails #8119

Open
canavan opened this issue Jan 2, 2016 · 2 comments
Open

friendly error messages if update fails #8119

canavan opened this issue Jan 2, 2016 · 2 comments

Comments

@canavan
Copy link

@canavan canavan commented Jan 2, 2016

If an update via -U fails, a stack trace is printed. A friendlier error message with a clear indication what failed (e.g. a timeout), would be nice.

$ youtube-dl --verbose -U
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'-U']
[debug] Encodings: locale ISO8859-1, fs ISO8859-1, out ISO8859-1, pref ISO8859-1
[debug] youtube-dl version 2015.12.06
[debug] Python version 2.7.11 - IRIX64-6.5-IP35-mips-n32bit-ELF
[debug] exe versions: ffmpeg UNKNOWN, ffprobe UNKNOWN, rtmpdump 2.2b
[debug] Proxy map: {'http': 'http://10.2.4.16:3128/', u'https': 'http://10.2.4.16:3128/'}
Updating to version 2016.01.01 ...
Traceback (most recent call last):
File "/usr/nekoware/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/nekoware/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/nekoware/bin/youtube-dl/main.py", line 19, in
File "/usr/nekoware/bin/youtube-dl/youtube_dl/init.py", line 410, in main
File "/usr/nekoware/bin/youtube-dl/youtube_dl/init.py", line 380, in _real_main
File "/usr/nekoware/bin/youtube-dl/youtube_dl/update.py", line 167, in update_self
File "/usr/nekoware/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/nekoware/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/nekoware/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/nekoware/bin/youtube-dl/youtube_dl/utils.py", line 813, in https_open
File "/usr/nekoware/lib/python2.7/urllib2.py", line 1200, in do_open
r = h.getresponse(buffering=True)
File "/usr/nekoware/lib/python2.7/httplib.py", line 1136, in getresponse
response.begin()
File "/usr/nekoware/lib/python2.7/httplib.py", line 453, in begin
version, status, reason = self._read_status()
File "/usr/nekoware/lib/python2.7/httplib.py", line 417, in _read_status
raise BadStatusLine(line)
httplib.BadStatusLine: ''

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jan 2, 2016

This is what returned by your proxy.

@dstftw dstftw closed this Jan 2, 2016
@canavan
Copy link
Author

@canavan canavan commented Jan 2, 2016

Without --verbose, the cause of the problem is not printed, even if no proxy is used:

$ http_proxy= youtube-dl -U
Updating to version 2016.01.01 ...
ERROR: unable to download latest version

with --verbose:

$ http_proxy= youtube-dl -U --verbose
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-U', u'--verbose']
[debug] Encodings: locale ISO8859-1, fs ISO8859-1, out ISO8859-1, pref ISO8859-1
[debug] youtube-dl version 2015.12.06
[debug] Python version 2.7.11 - IRIX64-6.5-IP35-mips-n32bit-ELF
[debug] exe versions: ffmpeg UNKNOWN, ffprobe UNKNOWN, rtmpdump 2.2b
[debug] Proxy map: {}
Updating to version 2016.01.01 ...
Traceback (most recent call last):
File "/usr/nekoware/bin/youtube-dl/youtube_dl/update.py", line 167, in update_self
urlh = opener.open(version['bin'][0])
File "/usr/nekoware/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/nekoware/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/nekoware/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(_args)
File "/usr/nekoware/bin/youtube-dl/youtube_dl/utils.py", line 813, in https_open
req, *_kwargs)
File "/usr/nekoware/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
URLError: <urlopen error [Errno 145] Connection timed out>

ERROR: unable to download latest version

@dstftw dstftw reopened this Jan 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.