-
Notifications
You must be signed in to change notification settings - Fork 310
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
Reformat error message output #587
Comments
Any error can be formatted this way including things we might raise that halt upload or anything else.we choose to let bubble up. That means we'd have to start branching for each potential exception to add special formatting such that main looks like try:
return cli.dispatcy(sys.argv[1:])
except requests.HTTPError as exc:
return """ERROR from ...
...
...
""".format(exc)
except exceptions.TwineException as exc:
return ...
except SomeOtherError as exc:
return And my experience with highly specific chains like that is that contributors find a new exception path and try to shove it into some existing path. My other concern is that people are checking the output of twine in automation (GitHub Actions, CI releases, etc.) and that changing it here will break their automation making this something of a breaking change. |
I do like the relative simplicity of the current handler in That said, it seems to me already have a bit of a special case for I also wondered about relying on
Yeah, that occurred to me, and I can see this change being released as Twine 4.0. I don't have stats on interactive vs. automated use, but it seems to me that the former is an important audience, and that making error messages easier to read would help users resolve issues on their own. |
As we make Twine into more of a library, logging errors is completely inaccessible to users of the library. Further logging imposes formatting requirements that are unnecessary and far from user-friendly. Flake8 uses logging for debugging purposes but generally speaking only the maintainers are patient enough to read those when debugging an issue with a user. |
Currently, Twine displays error messages like this:
I think something like this would be more helpful (though I'm not committed to this exact format):
For errors like this one from Warehouse, I think this makes the source and potential resolution more obvious, and might have mitigated issues like #577 and #424.
This might be a significant restructuring, since it seems like "expected" errors are displayed by a catch-all
except
:twine/twine/__main__.py
Lines 23 to 27 in f7402e0
Related:
The text was updated successfully, but these errors were encountered: