GoBooDo icon indicating copy to clipboard operation
GoBooDo copied to clipboard

Create robust error handling for different cases

Open vaibhavk97 opened this issue 4 years ago • 4 comments

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: https://github.com/vaibhavk97/GoBooDo/issues/43 and other similiar

vaibhavk97 avatar Apr 23 '21 17:04 vaibhavk97

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

Yolakalemowa avatar May 08 '21 12:05 Yolakalemowa

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

vaibhavk97 avatar May 08 '21 12:05 vaibhavk97

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 avatar Jul 29 '21 18:07 minamotorin

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.

minamotorin avatar Jul 29 '21 18:07 minamotorin