LeMyst / WikibaseIntegrator

A Python module to manipulate data on a Wikibase instance (like Wikidata) through the MediaWiki Wikibase API and the Wikibase SPARQL endpoint.
MIT License
67 stars 15 forks source link

improve exception handling/ debug options #506

Open WolfgangFahl opened 1 year ago

WolfgangFahl commented 1 year ago

currently the exception handling for api calls is limited and makes debugging hard:

try:
            json_result: dict = mediawiki_api_call_helper(data=payload, login=login, allow_anonymous=allow_anonymous, is_bot=is_bot, **kwargs)
        except Exception:
            logging.exception('Error while writing to the Wikibase instance')
            raise

better

except Exception as ex:
# check what type of exception occured and give hints on what to do
WolfgangFahl commented 1 year ago

see #459

WolfgangFahl commented 1 year ago

e.g. look at messages_names=['wikibase-validator-label-with-description-conflict']

WolfgangFahl commented 1 year ago

see #507