Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMore explicit error message when DSN alias is not found #1198
Conversation
| except: | ||
| except KeyError: | ||
| click.secho( | ||
| f"Could not find a DSN with alias {dsn}. " |
tomplex
Jul 27, 2020
Author
Contributor
I used an f-string because I see you support Python3.6+, but I'm happy to switch to a different form of string interpolation if there's a preferred method for the package.
j-bennet
Jul 31, 2020
Contributor
We are very happy with f-strings now that we don't have to support python 2. :)
Codecov Report
@@ Coverage Diff @@
## master #1198 +/- ##
==========================================
+ Coverage 83.72% 83.75% +0.03%
==========================================
Files 21 21
Lines 2531 2555 +24
==========================================
+ Hits 2119 2140 +21
- Misses 412 415 +3
Continue to review full report at Codecov.
|
|
Well done, thank you @tomplex! |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Description
Today I made a typo in a DSN alias while connecting, and the "invalid DSN" error made me look at my pgcli config file, wondering how it changed, before I realized I just misspelled the alias. So I figured it might be nice to make the error for that case more explicit.
I'm happy to add a test or two but I couldn't find any other tests for the
clifunction / error cases to base it off of.Checklist
changelog.rst.AUTHORSfile (or it's already there).pip install pre-commit && pre-commit install), and ranblackon my code.