Fix incorrect error strings in webmin (#128448)

This commit is contained in:
epenet 2024-10-16 13:39:46 +02:00 committed by GitHub
parent 5d079aacd6
commit 6442625a9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -26,7 +26,7 @@ from homeassistant.helpers.schema_config_entry_flow import (
SchemaFlowFormStep,
)
from .const import DEFAULT_PORT, DEFAULT_SSL, DEFAULT_VERIFY_SSL, DOMAIN
from .const import DEFAULT_PORT, DEFAULT_SSL, DEFAULT_VERIFY_SSL, DOMAIN, LOGGER
from .helpers import get_instance_from_options, get_sorted_mac_addresses
@ -45,9 +45,8 @@ async def validate_user_input(
raise SchemaFlowError("invalid_auth") from err
raise SchemaFlowError("cannot_connect") from err
except Fault as fault:
raise SchemaFlowError(
f"Fault {fault.faultCode}: {fault.faultString}"
) from fault
LOGGER.exception(f"Fault {fault.faultCode}: {fault.faultString}")
raise SchemaFlowError("unknown") from fault
except ClientConnectionError as err:
raise SchemaFlowError("cannot_connect") from err
except Exception as err:

View File

@ -74,7 +74,7 @@ async def test_form_user(
(Exception, "unknown"),
(
Fault("5", "Webmin module net does not exist"),
"Fault 5: Webmin module net does not exist",
"unknown",
),
],
)