saulpw / visidata

A terminal spreadsheet multitool for discovering and arranging data
http://visidata.org
GNU General Public License v3.0
7.49k stars 271 forks source link

[http-] on errors, show fail msg instead of traceback #2360

Closed midichef closed 2 weeks ago

midichef commented 2 months ago

When opening an URL causes an error, the user is shown a long traceback:

vd https://example.com/asdf
...
File "/usr/lib/python3.10/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

This PR changes it to a shorter error:

vd https://example.com/asdf
saul.pw/VisiData v3.1dev
Support VisiData: https://github.com/sponsors/saulpw
cannot open URL: HTTP Error 404: Not Found