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

Change: reworded many of the network errors during connect/listen #9230

Merged
merged 1 commit into from May 10, 2021

Conversation

TrueBrain
Copy link
Member

Motivation / Problem

#9017 gave a review comment that the debug statements in the ListenProc is a bit wonky. As a good citizen, I don't just fix the line I touched, but I went through all of them in both listen() and connect().

Description

I did a few things:

  • All errors now show the OS error too; otherwise debugging problems can be hard.
  • I bumped fatal errors to level 0, so the user actually sees what part failed.
  • I removed many of the "tcp" and "ipv4" prefixes; they are rarely relevant for the error happening.
  • I often removed the address from the error. For example, if socket() fails, it is not really important to what you were trying to listen(). The fact that we cannot do a simple socket() really is a big issue. Only if bind() fails, it is worth mentioning what we were trying to binding to.

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

Also changed some levels to 0, as a failing listen() is something
we should tell the user about. Hiding this information is a bit
evil.
Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@TrueBrain TrueBrain merged commit 8f4a612 into OpenTTD:master May 10, 2021
@TrueBrain TrueBrain deleted the network-errors branch May 10, 2021 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants