Skip to content
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

POST call return error if API token is invalid #137

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rsanchuk
Copy link

@rsanchuk rsanchuk commented Mar 21, 2023

This change will allow the user to receive an error in case the user's API TOKEN is invalid or the authentication didn't go through.
Currently, the user receives no response if the API TOKEN is invalid. This might mislead the user into thinking everything went well when it doesn't.

In previous attempts to add this minor fix, a test was required. So I also added a validation test to the test_data_reporting file to check if we indeed receive an error, and this is the output we will get in case of an invalid token:

ERROR:root:401 Client Error: Unauthorized for url: https://ingest.signalfx.com/v2/event
ERROR:root:401 Client Error: Unauthorized for url: https://ingest.signalfx.com/v2/datapoint
ERROR:root:401 Client Error: Unauthorized for url: https://ingest.signalfx.com/v2/datapoint

Let me know if something else is required.

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