Leseratte10 / acsm-calibre-plugin

Calibre plugin for ACSM->EPUB and ACSM->PDF conversion.
https://www.mobileread.com/forums/showthread.php?t=341975
GNU General Public License v3.0
593 stars 23 forks source link

Handle Connection Errors #76

Open mdpenguin opened 5 months ago

mdpenguin commented 5 months ago

Bug description

Feature request:

Please add handling when the request to the Adobe servers cannot be fulfilled

Current behavior:

When a server error occurs (e.g. 404 or 403), Calibre imports the ACSM file directly without stating why the plugin could not retrieve the ebook

Expected behavior:

Do not import ACSM file and throw a descriptive error message when unable to fulfill request with Adobe server. It would also be helpful to log to the job queue, as requested in #61.

Operating system

Linux

Which version of Calibre are you running?

6.29

Which version of the ACSM Input plugin are you running?

v0.0.16

Import type

Clicking the 'Add books' button in the menu bar

Further information

No response

Leseratte10 commented 5 months ago

I'd love to add that feature, but it's not that easy.

There's no API in Calibre for a FileType plugin to return any error message or show any error dialog box on import. All a file type plugin can (and must) return to Calibre is a file - either an EPUB or PDF on success or the ACSM on failure.

Same as for the job queue, the FileType plugin would somehow need to signal to the GUI plugin to pop up an error message.

Some time in the future I'll hopefully have some more time to look into all this.