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

Fix the string representation of ServerDisconnectedError #4188

Merged
merged 2 commits into from
Oct 17, 2019

Conversation

JenSte
Copy link
Contributor

@JenSte JenSte commented Oct 15, 2019

What do these changes do?

These changes make sure that the string representation of ServerDisconnectedError is always a valid, human readable string.

Are there changes in behavior for the user?

The user will never be surprised after calling str() on an instance of ServerDisconnectedError.

Related issue number

Fixes #4175.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
  • Add a new news fragment into the CHANGES folder

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 15, 2019
Copy link
Member

@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

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

I believe providing 'Server disconnected' default value for message could be enough:

if message is None:
    message = "Server disconnected"

__str__ is autogenerated from self.args[0].

@JenSte JenSte force-pushed the server-disconnected-str branch 2 times, most recently from 790fcc0 to 55d24f6 Compare October 16, 2019 18:36
@codecov-io
Copy link

codecov-io commented Oct 16, 2019

Codecov Report

Merging #4188 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4188      +/-   ##
==========================================
- Coverage   97.57%   97.56%   -0.02%     
==========================================
  Files          43       43              
  Lines        8825     8825              
  Branches     1381     1381              
==========================================
- Hits         8611     8610       -1     
- Misses         92       93       +1     
  Partials      122      122
Impacted Files Coverage Δ
aiohttp/client_exceptions.py 100% <100%> (ø) ⬆️
aiohttp/web_fileresponse.py 97.72% <0%> (-0.57%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6236536...5c60941. Read the comment docs.

@asvetlov asvetlov merged commit a54956d into aio-libs:master Oct 17, 2019
@asvetlov
Copy link
Member

Thanks!

asvetlov pushed a commit that referenced this pull request Oct 17, 2019
(cherry picked from commit a54956d)

Co-authored-by: JenSte <jens.steinhauser@protonmail.com>
asvetlov added a commit that referenced this pull request Oct 17, 2019
…) (#4208)

(cherry picked from commit a54956d)

Co-authored-by: JenSte <jens.steinhauser@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

String representation of ServerDisconnectedError should be more meaningful
3 participants