Fix subtitle post-processing error losing original exception#13256
Merged
TobiGr merged 1 commit intoTeamNewPipe:devfrom Feb 19, 2026
Merged
Conversation
Previously, TtmlConverter.process() caught all exceptions during TTML to SRT conversion and returned opaque error codes (1 for IOException, 8 for other exceptions). These error codes were then wrapped by Postprocessing.run() into a generic RuntimeException with the message 'post-processing algorithm returned N', losing the original exception and its stack trace. This made it impossible for users and developers to diagnose the root cause of subtitle download failures, as reported in TeamNewPipe#13206. Now, IOExceptions are re-thrown directly, and other exceptions are wrapped in an IOException with the original exception as the cause. This allows DownloadMission.doPostprocessing() to properly catch and report the actual error, including the full stack trace in the crash report. Fixes TeamNewPipe#13206 Signed-off-by: pierreeurope <[email protected]>
|
From nightly Exception
Crash log
|
|
And from the new version. Exception
Crash log
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this?
This PR fixes the error reporting in subtitle (TTML → SRT) post-processing, addressing #13206.
The problem
When subtitle post-processing fails, users see a generic error:
This happens because
TtmlConverter.process()catches all exceptions and returns opaque integer error codes (1 for IOException, 8 for anything else).Postprocessing.run()then wraps this code into a newRuntimeException, discarding the original exception and its stack trace entirely.This makes it impossible to diagnose the actual root cause of subtitle download failures.
The fix
Instead of catching exceptions and returning error codes, the exceptions are now propagated properly:
IOExceptionwith the original exception preserved as the causeThis allows
DownloadMission.doPostprocessing()to catch and report the actual error with its full stack trace, which will appear in user crash reports.Why this approach
The
process()method's return-code-based error handling was designed for cases where partial recovery is possible (like in muxers). ForTtmlConverter, there is no partial recovery — a parse failure is fatal. Propagating the exception is more idiomatic and preserves diagnostic information that is critical for debugging issues like #13206.APK testing
This is a minimal, low-risk change to error handling only — no behavioral change when conversion succeeds.