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

Add error message for improperly configured server.listen #981

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

sjrct
Copy link
Contributor

@sjrct sjrct commented Jan 15, 2024

Checklist

  • All new and existindocs/docs/technical-docs/testing.rstg tests are passing
  • I have written proper commit message(s)

What changes does this Pull Request introduce?

Add error message for improperly configured server.listen

Why is this necessary?

Otherwise the error message is quite cryptic, what I saw was ultimately:

AttributeError: 'int' object has no attribute 'strip'

Copy link
Contributor

@BBaoVanC BBaoVanC left a comment

Choose a reason for hiding this comment

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

Looks good, I think there's a small typo though

isso/__init__.py Outdated
sock = conf.get("server", "listen").partition("unix://")[2]
try:
os.unlink(sock)
except OSError as ex:
if ex.errno != errno.ENOENT:
raise
wsgi.SocketHTTPServer(sock, make_app(conf)).serve_forever()
else:
logger.error("server.listen must specif a protocol of http:// or unix://")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should say "specify" instead of "specif"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

If the protocol is not specified/wrong the error message is quite cryptic
@ix5
Copy link
Member

ix5 commented Jan 20, 2024

@BBaoVanC if you're satisfied, I would like to merge this.

@ix5 ix5 merged commit 1429ed1 into isso-comments:master Jan 22, 2024
10 checks passed
@ix5 ix5 added server (Python) server code improvement Not a new feature, but makes Isso more pleasant to use labels Jan 22, 2024
@ix5 ix5 added this to the 0.14 milestone Jan 22, 2024
@sjrct sjrct deleted the listen-proto-error-msg branch February 16, 2024 05:10
@ix5 ix5 modified the milestones: 0.14, 0.13.1 May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Not a new feature, but makes Isso more pleasant to use server (Python) server code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants