-
Notifications
You must be signed in to change notification settings - Fork 18
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
Show detailed exception only when needed #230
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that the stack trace is still accessible when in verbose mode, however there is a point from the Jira ticket that is still missing in the PR. Specifically, we need to add a more user friendly error message that can provide details on what the user can check to resolve the error. This could simply be the suggested error message as in the ticket:
“401 Client Error: Unauthorized for URL [URL]. Please ensure that your CommCare HQ username and API Key are accurate, and verify that your account has the necessary permissions to access the DET tool.”
Thanks for the feedback @zandre-eng I totally missed that. I thought the request was to show specific error. I will update that now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. One comment, although not blocking.
Co-authored-by: Zandre Engelbrecht <[email protected]>
4a5b8db
to
7c1d36e
Compare
logger.error( | ||
f"#{e}. Please ensure that your CommCare HQ credentials are correct & valid for " | ||
f"the auth-mode passed. Also, Verify that your account has the necessary " | ||
f"permissions to access the DET tool." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
("the DET tool" means "the data export tool tool".) But I'm wondering whether the user knows that Dimagi internally refers to this as "the DET". In help text this command refers to itself as "commcare-export" or "the commcare-export tool". I think this text might be more familiar to a user:
f"permissions to access the DET tool." | |
f"permissions to use commcare-export." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Thank you
https://dimagi.atlassian.net/browse/SC-3354
raise for status
raises an exception in case of authentication failures which leads to a full stacktrace shown.Seems reasonable to limit showing the full stacktrace only for verbose (debug) mode.
Also, update error message to a better message to let user know what all to check for in case of authentication failures.