Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

logging and error changes#141

Merged
tianj7 merged 4 commits intomasterfrom
feat/Brh_logging_fix
Jul 13, 2022
Merged

logging and error changes#141
tianj7 merged 4 commits intomasterfrom
feat/Brh_logging_fix

Conversation

@tianj7
Copy link
Contributor

@tianj7 tianj7 commented Jul 13, 2022

BMH-111

Improvements

Logging and error improvement.

@github-actions
Copy link

The style in this PR agrees with black. ✔️

This formatting comment was generated automatically by a script in uc-cdis/wool.

gen3/auth.py Outdated
"No idp matched with the endpoint or idp value provided.\n"
+ "Please make sure your endpoint or idp value matches exactly with the output below.\n"
+ "i.e. check trailing '/' character for the endpoint url\n"
+ "Avalable Idps:"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
+ "Avalable Idps:"
+ "Available Idps:"

gen3/auth.py Outdated
"No idp matched with the endpoint or idp value provided.\n"
+ "Please make sure your endpoint or idp value matches exactly with the output below.\n"
+ "i.e. check trailing '/' character for the endpoint url\n"
+ "Avalable Idps:"
Copy link
Contributor

Choose a reason for hiding this comment

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

How about using triple quotes for the ValueError string so that \n and + aren't required?

Copy link
Contributor Author

@tianj7 tianj7 Jul 13, 2022

Choose a reason for hiding this comment

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

I experimented with using triple quotes string. I needed to format in the idp_list variable and somehow this makes the error message look funky with all the extra indents. See below. Tried to solve this using textwrap.dedent() and inspect.cleandoc() but neither work with a string that's been formatted. Think keeping it as is probably the way to go for now.

   ValueError: No idp matched with the endpoint or idp value provided.
                               Please make sure your endpoint or idp value matches exactly with the output below.
                               i.e. check trailing '/' character for the endpoint url
                              Available Idps:
                               
            idp name: test-google  Endpoint url: https://test-commons.org
            
                               Query /wts/external_oidc/ for more information.

@tianj7 tianj7 merged commit 2634faf into master Jul 13, 2022
@tianj7 tianj7 deleted the feat/Brh_logging_fix branch July 13, 2022 19:33
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.

2 participants