Change error handling in get_subscribers()
in Zulip API client.
Fixes #3281.
This commit is contained in:
parent
105b0ab0dc
commit
229471c70f
|
@ -659,11 +659,11 @@ class Client(object):
|
||||||
'''
|
'''
|
||||||
Example usage: client.get_subscribers(stream='devel')
|
Example usage: client.get_subscribers(stream='devel')
|
||||||
'''
|
'''
|
||||||
request_stream_id = self.get_stream_id(request['stream'])
|
response = self.get_stream_id(request['stream'])
|
||||||
try:
|
if response['result'] == 'error':
|
||||||
stream_id = request_stream_id['stream_id']
|
return response
|
||||||
except KeyError:
|
|
||||||
return request_stream_id
|
stream_id = response['stream_id']
|
||||||
url = 'streams/%d/members' % (stream_id,)
|
url = 'streams/%d/members' % (stream_id,)
|
||||||
return self.call_endpoint(
|
return self.call_endpoint(
|
||||||
url=url,
|
url=url,
|
||||||
|
|
Loading…
Reference in a new issue