You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
I often forget I already have a server running on localhost:8080, and whenever I run mkdocs serve I get a huge stack trace with a '[Errno 98] Address already in use' at the end. I think we should just catch socket errors and spit out the error message, like for ConfigurationError. Here's what you could do. Should we catch all socket errors though? Or just keep 98 and re-throw the rest?
The text was updated successfully, but these errors were encountered:
Sorry if my tone was off. I noticed that @samhatfield had asked for feedback on his proposed change. However he hadn't received any feedback specifically about that (at least by my reading) -- only that the general request was reasonable. I was trying to tell him that I thought his proposed change looked good and he should submit a PR. Of course, final approval comes from @d0ugal so I did not give any definitive statements regarding whether such a PR would be accepted.
I was just about to submit a PR earlier, but then I saw that socket.error is a deprecated alias of OSError as of Python 3.3. OSError seems too broad to catch, and I couldn't find any appropriate subclasses. If you guys think it's fine as it is though, I'll submit a PR.
Well, for Python < 3.3 we would still need to catch the socket.error so it doesn't cause any harm to leave it in. It appears that up through 3.6socket.error will still be in the code base--it just inherits from a different parent class. So I would say leave it as-is.
Although, an argument could be made to catch all errors on the command line (except when in debug mode) and only output the message. However, I expect that would be a more complex issue that should be implemented across the entire CLI.