mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Update stream errors with additional error information (#62900)
This commit is contained in:
parent
2f7fa962b4
commit
23384ee1e8
@ -448,7 +448,7 @@ def stream_worker(
|
|||||||
container = av.open(source, options=options, timeout=SOURCE_TIMEOUT)
|
container = av.open(source, options=options, timeout=SOURCE_TIMEOUT)
|
||||||
except av.AVError as err:
|
except av.AVError as err:
|
||||||
raise StreamWorkerError(
|
raise StreamWorkerError(
|
||||||
"Error opening stream %s" % redact_credentials(str(source))
|
f"Error opening stream ({err.type}, {err.strerror}) {redact_credentials(str(source))}"
|
||||||
) from err
|
) from err
|
||||||
try:
|
try:
|
||||||
video_stream = container.streams.video[0]
|
video_stream = container.streams.video[0]
|
||||||
|
@ -716,7 +716,10 @@ async def test_worker_log(hass, caplog):
|
|||||||
av_open.side_effect = av.error.InvalidDataError(-2, "error")
|
av_open.side_effect = av.error.InvalidDataError(-2, "error")
|
||||||
run_worker(hass, stream, "https://abcd:efgh@foo.bar")
|
run_worker(hass, stream, "https://abcd:efgh@foo.bar")
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert str(err.value) == "Error opening stream https://****:****@foo.bar"
|
assert (
|
||||||
|
str(err.value)
|
||||||
|
== "Error opening stream (ERRORTYPE_-2, error) https://****:****@foo.bar"
|
||||||
|
)
|
||||||
assert "https://abcd:efgh@foo.bar" not in caplog.text
|
assert "https://abcd:efgh@foo.bar" not in caplog.text
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user