Skip to content

Commit

Permalink
Update baseentity.py
Browse files Browse the repository at this point in the history
  • Loading branch information
LeMyst committed May 31, 2022
1 parent 92a8a3d commit 18954ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wikibaseintegrator/entities/baseentity.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,17 @@ def _write(self, data: Dict = None, summary: str = None, login: _Login = None, a

try:
json_result: dict = mediawiki_api_call_helper(data=payload, login=login, allow_anonymous=allow_anonymous, is_bot=is_bot, **kwargs)

except Exception:
print('Error while writing to the Wikibase instance')
raise
else:
if 'error' in json_result and 'messages' in json_result['error']:
error_msg_names = {x.get('name') for x in json_result['error']['messages']}
if 'wikibase-validator-label-with-description-conflict' in error_msg_names:
raise NonUniqueLabelDescriptionPairError(json_result)

if 'error' in json_result:
raise MWApiError(json_result)
except Exception:
print('Error while writing to the Wikibase instance')
raise

return json_result['entity']

Expand Down

0 comments on commit 18954ee

Please sign in to comment.