Skip to content

Commit 6442625

Browse files
authored
Fix incorrect error strings in webmin (#128448)
1 parent 5d079aa commit 6442625

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

homeassistant/components/webmin/config_flow.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
SchemaFlowFormStep,
2727
)
2828

29-
from .const import DEFAULT_PORT, DEFAULT_SSL, DEFAULT_VERIFY_SSL, DOMAIN
29+
from .const import DEFAULT_PORT, DEFAULT_SSL, DEFAULT_VERIFY_SSL, DOMAIN, LOGGER
3030
from .helpers import get_instance_from_options, get_sorted_mac_addresses
3131

3232

@@ -45,9 +45,8 @@ async def validate_user_input(
4545
raise SchemaFlowError("invalid_auth") from err
4646
raise SchemaFlowError("cannot_connect") from err
4747
except Fault as fault:
48-
raise SchemaFlowError(
49-
f"Fault {fault.faultCode}: {fault.faultString}"
50-
) from fault
48+
LOGGER.exception(f"Fault {fault.faultCode}: {fault.faultString}")
49+
raise SchemaFlowError("unknown") from fault
5150
except ClientConnectionError as err:
5251
raise SchemaFlowError("cannot_connect") from err
5352
except Exception as err:

tests/components/webmin/test_config_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async def test_form_user(
7474
(Exception, "unknown"),
7575
(
7676
Fault("5", "Webmin module net does not exist"),
77-
"Fault 5: Webmin module net does not exist",
77+
"unknown",
7878
),
7979
],
8080
)

0 commit comments

Comments
 (0)