[twitter] raise proper exception if user doesn't exist (#891)

This commit is contained in:
Mike Fährmann
2020-07-14 16:47:25 +02:00
parent df7217c36d
commit 2da71cb561

View File

@@ -485,7 +485,10 @@ class TwitterAPI():
"variables": '{"screen_name":"' + screen_name + '"'
',"withHighlightedLabel":true}'
}
return self._call(endpoint, params)["data"]["user"]
try:
return self._call(endpoint, params)["data"]["user"]
except KeyError:
raise exception.NotFoundError("user")
@cache(maxage=3600)
def _guest_token(self):