Print explicit information on MuPDF Fitz count_pages error#377
Open
randomnoise wants to merge 2 commits intobaskerville:masterfrom
Open
Print explicit information on MuPDF Fitz count_pages error#377randomnoise wants to merge 2 commits intobaskerville:masterfrom
randomnoise wants to merge 2 commits intobaskerville:masterfrom
Conversation
baskerville
reviewed
Sep 10, 2024
| let page_count: i32 = mp_count_pages(self.ctx.0, self.doc); | ||
|
|
||
| if page_count <= 0 { | ||
| eprintln!("Error: MuPDF Fitz count_pages function returned {}.", page_count); |
Owner
There was a problem hiding this comment.
MuPDF prints errors on stderr, so this shouldn't be necessary.
Contributor
Author
There was a problem hiding this comment.
If I understood correctly, Plato does not go that far in the process for MuPDF to throw an error and write it to stdout/stderr or to any .log file.
fz_count_pages and its subroutines look like they're fairly simple and don't throw errors, just return 0.
14e9bc0 to
bafc564
Compare
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.
The change makes sure when user selects a book, the application prints file's path even if there is a problem on the process, it also prints an information about MuPDF's fz_count_pages function error.
Related to #376.