Skip to content

Commit

Permalink
Fix incorrect error strings in webmin (#128448)
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet authored Oct 16, 2024
1 parent 5d079aa commit 6442625
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions homeassistant/components/webmin/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
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


Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/components/webmin/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
),
],
)
Expand Down

0 comments on commit 6442625

Please sign in to comment.