diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a0f77b3f4dc15747f6b8b84801b4bae3c04ab67d..5762917754840d67c7680d089926072e11a5cdfc 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,7 +11,8 @@ Changelog * Fix compatibility issues with HF 24 * account get_follow_count, get_followers and get_following have been fixed * improved get_discussions calls, fallback to condenser when tags api not available -* Fix detection when content does not exists +* Fix detection when content does not exists on HF24 +* Fix detection when a vote does not exists on HF24 0.24.9 ------ diff --git a/beem/vote.py b/beem/vote.py index 94cf30b74921d6e15ac4df3c32d71a733c2a3099..7688c603530dd2512276a4b990438e02971020e9 100644 --- a/beem/vote.py +++ b/beem/vote.py @@ -102,7 +102,11 @@ class Vote(BlockchainObject): try: votes = self.blockchain.rpc.get_active_votes({'author': author, 'permlink': permlink}, api="tags")['votes'] except: - votes = self.blockchain.rpc.get_active_votes(author, permlink, api="database_api") + from beemapi.exceptions import InvalidParameters + try: + votes = self.blockchain.rpc.get_active_votes(author, permlink, api="database_api") + except InvalidParameters: + raise VoteDoesNotExistsException(self.identifier) else: votes = self.blockchain.rpc.get_active_votes(author, permlink, api="database_api") except UnkownKey: @@ -378,8 +382,11 @@ class ActiveVotes(VotesObject): # votes = authorperm["active_votes"] if self.blockchain.rpc.get_use_appbase(): self.blockchain.rpc.set_next_node_on_empty_reply(False) + from beemapi.exceptions import InvalidParameters try: votes = self.blockchain.rpc.get_active_votes(authorperm["author"], authorperm["permlink"], api="condenser") + except InvalidParameters: + raise VoteDoesNotExistsException(construct_authorperm(authorperm["author"], authorperm["permlink"])) except: votes = self.blockchain.rpc.get_active_votes({'author': authorperm["author"], 'permlink': authorperm["permlink"]}, @@ -391,8 +398,11 @@ class ActiveVotes(VotesObject): [author, permlink] = resolve_authorperm(authorperm) if self.blockchain.rpc.get_use_appbase(): self.blockchain.rpc.set_next_node_on_empty_reply(False) + from beemapi.exceptions import InvalidParameters try: votes = self.blockchain.rpc.get_active_votes(author, permlink, api="condenser") + except InvalidParameters: + raise VoteDoesNotExistsException(construct_authorperm(author, permlink)) except: votes = self.blockchain.rpc.get_active_votes({'author': author, 'permlink': permlink},