Skip to content

Fix error message formatting in _handle_proxies and grammatical error#1398

Open
JosephPTM1 wants to merge 1 commit into
cubewise-code:masterfrom
JosephPTM1:fix/error-messages
Open

Fix error message formatting in _handle_proxies and grammatical error#1398
JosephPTM1 wants to merge 1 commit into
cubewise-code:masterfrom
JosephPTM1:fix/error-messages

Conversation

@JosephPTM1
Copy link
Copy Markdown
Contributor

Python doesn't allow "%s", in exceptions, this will raise the exception as a tuple with "Invalid JSON passed for argument 'proxies': %s" as a literal string and proxies as the other element in the tuple. I have changed it to an f string in this case rather than adapting it to "%s" % proxies because TM1py is targeting Python 3.7 and f strings are faster and more readable. I tested this and it does indeed just raise that tuple.

That being said, feel free to change this to "%s" % proxies if the consistency of it is important.

I also spotted a minor grammatical error while reading through the rest of the code with the line Must be to be of type 'bool' or 'str'".

@JosephPTM1
Copy link
Copy Markdown
Contributor Author

Apologies for raising 2 PRs in what could have been 1. The first was a fix for something I had just personally experienced, this one was through just reading the rest of the code out of intrigue.

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.

1 participant