openpreserve / carrus

1 stars 4 forks source link

Provide more user-friendly error message in case of missing tools #18

Closed bitsgalore closed 2 years ago

bitsgalore commented 3 years ago

When I first tried to identify a file I got the following error:

Traceback (most recent call last): File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/opt/OPF Carrus/resources/libs/fido/fido/fido.py", line 31, in from .package import OlePackage, ZipPackage File "/opt/OPF Carrus/resources/libs/fido/fido/package.py", line 6, in import olefile ModuleNotFoundError: No module named 'olefile'

On closer inspection it turns out I didn't have Fido installed on my system, and after installing it the error disappeared. I would expect a more user-friendly error message (e.g. "Fido missing, please install from .... etc").

Side note: the "Send report" button that is shown in the error widget doesn't appear to have any effect (but maybe this is only a mock-up at this stage?).

Tested on Linux Mint 19.3 Tricia (MATE desktop).

bdoubrov commented 3 years ago

The issue not in the missing tool, but in the error when running the tool (in this case, the script FIDO.py).

In more detail, from the FIDO readme:

FIDO 1.3.4 and later requires the python dependency 'olefile'. This can be installed using pip install olefile, by running python setup.py install, or a pip installation will handle dependencies.

Currently OPF Carrus doesn't run this setup.py at the install time. To be fixed.

bitsgalore commented 3 years ago

@bdoubrov You're right, I didn't realize jhove/fido/jpylyzer/veraPDF were actually included in the Carrus distribution