Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly log validation errors when parsing VideoInfo #12

Open
daniil-berg opened this issue Sep 13, 2024 · 0 comments
Open

Properly log validation errors when parsing VideoInfo #12

daniil-berg opened this issue Sep 13, 2024 · 0 comments
Assignees
Labels
error handling More helpful and transparent error handling/logging

Comments

@daniil-berg
Copy link
Contributor

Currently the get_ffprobe_info function simply replaces a ValidationError with an FFProbeError that contains the stderr string from the sub-process.

try:
stdout, stderr = await wait_for(proc.communicate(), timeout_seconds)
except AsyncioTimeoutError:
proc.kill()
raise FFProbeError(timeout=True) from None
try:
return VideoInfo.parse_raw(stdout.decode())
except ValidationError:
# TODO: Passing `stderr` and discarding the `ValidationError` is wrong;
# ensure validation problems are properly logged!
raise FFProbeError(stderr=stderr.decode()) from None

There should probably be two distinct error paths: One handling a non-empty stderr and the other handling a validation error when parsing stdout.

@daniil-berg daniil-berg self-assigned this Sep 13, 2024
@daniil-berg daniil-berg added the error handling More helpful and transparent error handling/logging label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error handling More helpful and transparent error handling/logging
Projects
None yet
Development

No branches or pull requests

1 participant