Fix raise-within-try in config validation helper (#123353)

This commit is contained in:
epenet 2024-08-08 18:50:49 +02:00 committed by GitHub
parent c2f2a868c4
commit ddc94030a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -770,9 +770,9 @@ def socket_timeout(value: Any | None) -> object:
float_value = float(value)
if float_value > 0.0:
return float_value
raise vol.Invalid("Invalid socket timeout value. float > 0.0 required.")
except Exception as err:
raise vol.Invalid(f"Invalid socket timeout: {err}") from err
raise vol.Invalid("Invalid socket timeout value. float > 0.0 required.")
def url(