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

Create robust error handling for different cases #45

Open
vaibhavk97 opened this issue Apr 23, 2021 · 4 comments
Open

Create robust error handling for different cases #45

vaibhavk97 opened this issue Apr 23, 2021 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@vaibhavk97
Copy link
Owner

Many instances of errors have been reported wherein the error does not make it clear if the issue is with the network or the program. Need to make Error handling more robust.

Such as: #43 and other similiar

@vaibhavk97 vaibhavk97 added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Apr 23, 2021
@Yolakalemowa
Copy link

I just got this error for the first time, does this belong here? Or need to open new issue?

Downloading Race After Technology: Abolitionist Tools for the New Jim Code - Ruha Benjamin
An earlier download attempt was detected, GoBooDo will continue using the previous state.
The total pages available for fetching are 54
Traceback (most recent call last):
File "goboodo.py", line 217, in
book.start()
File "goboodo.py", line 175, in start
self.insertIntoPageDict(interimData)
UnboundLocalError: local variable 'interimData' referenced before assignment

@vaibhavk97
Copy link
Owner Author

Seems like a new bug, please create a new issue.

@minamotorin
Copy link

When no images were saved, makePDF.py causes IndexError: list index out of range every time. It is hard to understand that the cause of the error is store images failure.

My suggestion is insert error handling code like following to line 13 on makePDF.py:

        if self.imageNameList == []:
            [Error handling]

And sometimes a cause of store images failure is luck of tesseract.exe (such as #32, and #53). I think this should be notified when this error occurs.

Example of [Error handling] is following:

        print("""Could not make PDF because no images were found.
        If you got following error, please put tesseract.ext on tesseract_path of settings.json:
          C:\program Files\Tesseract-OCR\tesseract.exe is not installed or it's not in your PATH. See README file for more information.""")
        exit(1)

This message should get feedbacks.

@minamotorin
Copy link

minamotorin commented Jul 29, 2021

ModuleNotFoundError has same issue. Sometimes /usr/bin/python3 is not used. E.g. I use pyenv, and python3 I use is on ~/.pyenv/shims/python3. Many scripts will havs same issue.

One solution is change shebang (#!/usr/bin/python3) to #!/usr/bin/env python3. But I don't know if /usr/bin/env is usually exists on any UNIX machine or not and behavior on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants