diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-10-01 13:24:11 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-10-01 13:24:11 +0200 |
| commit | 8bdeacc966d24cb47713df7b4213340565c505c8 (patch) | |
| tree | ff14ad3bd6e9cfbdc59b031e0e3a53f5066d6872 /packages/meshbay-node/tests/test_member_errors_are_plain.py | |
| parent | 1d6189b6e6db7d0d6c126717b081901c5f552174 (diff) | |
| download | meshbay-8bdeacc966d24cb47713df7b4213340565c505c8.tar.gz | |
fix(node): a member is told a media tool failed, not what ffmpeg said
Stream, transcode and subtitle failures sent the exception's text — operator
paths, versions — to the member. Fixed messages now, the cause in the log
(F-24).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-node/tests/test_member_errors_are_plain.py')
| -rw-r--r-- | packages/meshbay-node/tests/test_member_errors_are_plain.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/meshbay-node/tests/test_member_errors_are_plain.py b/packages/meshbay-node/tests/test_member_errors_are_plain.py new file mode 100644 index 0000000..e144e9b --- /dev/null +++ b/packages/meshbay-node/tests/test_member_errors_are_plain.py @@ -0,0 +1,22 @@ +""" +What a member is told when the media tools fail: that it failed. + +An exception's text from ffmpeg or ffprobe names the operator's paths, versions +and the libraries the build has; the member who asked needs none of it, and the +operator finds it in their log. Read from the source, because what matters is +that no reply in these handlers carries an exception's text at all. +""" + +import re +from pathlib import Path + +APPS = Path(__file__).resolve().parents[1] / "src" / "meshbay_node" / "transport" / "webrtc" + + +def test_no_reply_to_a_member_carries_an_exceptions_text(): + offenders = [] + for path in APPS.rglob("*.py"): + text = path.read_text(encoding="utf-8") + for m in re.finditer(r'"detail":\s*(f"[^"]*\{e\}[^"]*"|str\(e\))', text): + offenders.append(f"{path.name}: {m.group(0)}") + assert not offenders, offenders |