diff --git a/locales/en.json b/locales/en.json index af099b42f..07a46b8df 100644 --- a/locales/en.json +++ b/locales/en.json @@ -319,6 +319,7 @@ "domain_uninstall_app_first": "Those applications are still installed on your domain:\n{apps}\n\nPlease uninstall them using 'yunohost app remove the_app_id' or move them to another domain using 'yunohost app change-url the_app_id' before proceeding to domain removal", "domain_registrar_is_not_configured": "The registrar is not yet configured for domain {domain}.", "domain_dns_push_not_applicable": "The DNS push feature is not applicable to domain {domain}", + "domain_dns_push_failed_to_authenticate": "Failed to authenticate on registrar's API. Most probably the credentials are incorrect? (Error: {error})", "domain_config_mail_in": "Incoming emails", "domain_config_mail_out": "Outgoing emails", "domain_config_xmpp": "XMPP", diff --git a/src/yunohost/dns.py b/src/yunohost/dns.py index 341a66ad7..8bc48a5ac 100644 --- a/src/yunohost/dns.py +++ b/src/yunohost/dns.py @@ -605,7 +605,11 @@ def domain_dns_push(operation_logger, domain, dry_run=False, force=False, purge= .with_dict(dict_object={"action": "list", "type": "all"}) ) client = LexiconClient(query) - client.provider.authenticate() + try: + client.provider.authenticate() + except Exception as e: + raise YunohostValidationError("domain_dns_push_failed_to_authenticate", error=str(e)) + try: current_records = client.provider.list_records() except Exception as e: