Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
) # Description of Changes Please provide a summary of the changes, including: - **What was changed**: - Modified the `ProcessExecutor` class to accept exit code `3` from **qpdf** as a success with warnings. - Added a check to ensure that only **qpdf**’s exit code `3` is treated as a warning. - Added a warning log for **qpdf** exit code `3` to provide better visibility into the repair process. - **Why the change was made**: - The repair process was failing when **qpdf** returned exit code `3`, even though the operation succeeded with warnings. This caused unnecessary errors for users. - The changes ensure that PDFs with minor structural issues (e.g., mismatched object counts) are still repaired successfully, while logging warnings for transparency. - Added a check to ensure that only **qpdf**’s exit code `3` is treated as a warning, preventing potential issues with other tools that might use exit code `3` for actual errors. Closes #2842 --- ## Checklist ### General - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [x] I have performed a self-review of my own code - [x] My changes generate no new warnings ### Testing (if applicable) - [x] I have tested my changes locally. - Verified that exit code `3` is only treated as a warning for **qpdf** and not for other tools. --- ### Additional Notes - The changes align with **qpdf**'s behavior, where exit code `3` indicates a successful operation with warnings. - Added a check to ensure that only **qpdf**’s exit code `3` is treated as a warning, preventing potential issues with other tools. Co-authored-by: Anthony Stirling <[email protected]>
- Loading branch information