[instagram] improve error for non-existent profiles (#8550)
This commit is contained in:
@@ -871,8 +871,11 @@ class InstagramRestAPI():
|
||||
def user_by_name(self, screen_name):
|
||||
endpoint = "/v1/users/web_profile_info/"
|
||||
params = {"username": screen_name}
|
||||
return self._call(
|
||||
endpoint, params=params, notfound="user")["data"]["user"]
|
||||
try:
|
||||
return self._call(
|
||||
endpoint, params=params, notfound="user")["data"]["user"]
|
||||
except KeyError:
|
||||
raise exception.NotFoundError("user")
|
||||
|
||||
@memcache(keyarg=1)
|
||||
def user_by_id(self, user_id):
|
||||
|
||||
Reference in New Issue
Block a user