Added helpful messages to twitter model (#1622)

* Added helpful messages

* ran black on file

Co-authored-by: Chavithra <chavithra@gmail.com>
This commit is contained in:
meatpi
2022-04-03 19:40:59 +01:00
committed by GitHub
parent 1e24d02e1e
commit 406a6dc1be

View File

@@ -80,6 +80,22 @@ def load_analyze_tweets(
This means you are requesting data from beyond the API's 7 day limit"""
)
return pd.DataFrame()
elif response.status_code == 403:
console.print(
f"""
Status code 403.
It seems you're twitter credentials are invalid - {response.text}
"""
)
return pd.DataFrame()
else:
console.print(
f"""
Status code {response.status_code}.
Something went wrong - {response.text}
"""
)
return pd.DataFrame()
sentiments = []
pos = []