Skip to content

Improve error handling and update OCR API JSON key from "latex_styled" to "text" #26

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joliss
Copy link

@joliss joliss commented Mar 10, 2025

This code in convert.js

    try {
      fs.writeFileSync(destination, responseJSON["text_display"]);
    } catch (err) {
      console.log(`Could not write to destination path: ${destination}`);
      return process.exit(1);
    }

just prints "Could not write to destination path" when the "text_display" key is missing. This PR improves the error handling and updates the JSON key.

This is a bug report more so than a PR -- I won't have the bandwidth to update this PR, but feel free to use it as a starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant