From 18954ee9ff126230c0af02734cab70b7e016294f Mon Sep 17 00:00:00 2001 From: Myst <1592048+LeMyst@users.noreply.github.com> Date: Tue, 31 May 2022 17:48:54 +0200 Subject: [PATCH] Update baseentity.py --- wikibaseintegrator/entities/baseentity.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wikibaseintegrator/entities/baseentity.py b/wikibaseintegrator/entities/baseentity.py index 0d7c1cde..f9229299 100644 --- a/wikibaseintegrator/entities/baseentity.py +++ b/wikibaseintegrator/entities/baseentity.py @@ -239,7 +239,10 @@ 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: @@ -247,9 +250,6 @@ def _write(self, data: Dict = None, summary: str = None, login: _Login = None, a if 'error' in json_result: raise MWApiError(json_result) - except Exception: - print('Error while writing to the Wikibase instance') - raise return json_result['entity']