-
Notifications
You must be signed in to change notification settings - Fork 170
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
Added helpful error responses to webhook test notifications #5822
Added helpful error responses to webhook test notifications #5822
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.
Sorry this got overlooked earlier this season. This is amazing thanks so much
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## py3 #5822 +/- ##
==========================================
- Coverage 93.10% 92.88% -0.23%
==========================================
Files 658 656 -2
Lines 42145 42580 +435
Branches 60 60
==========================================
+ Hits 39241 39551 +310
- Misses 2896 3021 +125
Partials 8 8 ☔ View full report in Codecov by Sentry. |
When a webhook test notification fails, the alert div below the button will now give more specific errors.
Description
I modified apidocs_webhooks.html to display all errors in the alert div below the button instead of using
alert()
for some, and I modified apidocs.py to send JSON responses for specific errors, e.g. invalid or not specified match keys.Motivation and Context
Unfortunately this still doesn't help with the CSRF Expired error that occurs on the TBA prod site, since the error object from a failed authentication call returns HTML, and it'd be unsafe to set the HTML inside the alert div from a web response. However, this will help in the case where there's an error inside apidocs.py
apidocs_webhooks_notification
function.How Has This Been Tested?
Tested by putting valid and invalid match / event keys into the webhook testing page.
Screenshots (if appropriate):
Example error message: (on my local database, I don't have events from 2014, so it shows a 'not found')
Types of changes