Skip to content

Commit

Permalink
Twitter - Notify users about API changes in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
PrimozGodec committed Aug 18, 2023
1 parent abab01e commit 5841185
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions orangecontrib/text/widgets/owtwitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ class Info(OWWidget.Information):
)

class Error(OWWidget.Error):
api_error = Msg("Api error: {}")
api_error = Msg(
"Api error: {}. Check if your API plan includes Tweets retrieval. "
"The free plan doesn't allow Tweets retrieval anymore."
)
empty_query = Msg("Please provide {}.")
key_missing = Msg("Please provide a valid API token.")
wrong_author = Msg("Author '{}' does not exist.")
Expand Down Expand Up @@ -280,7 +283,7 @@ def on_exception(self, ex):
if isinstance(ex, NoAuthorError):
self.Error.wrong_author(str(ex))
else:
self.Error.api_error(str(ex))
self.Error.api_error(str(ex).replace("\n", " "))

def on_partial_result(self, _):
pass
Expand Down

0 comments on commit 5841185

Please sign in to comment.