05-09-2012, 02:59 PM | #1 |
Enthusiast
Posts: 39
Karma: 10
Join Date: Feb 2012
Location: Las Vegas, NV
Device: nook Simple GlowLight
|
How Do I? Fail silently when no articles to DL
Is there any hack or other way to cleanly fail if there is no articles to download?
I understand that a completely silent failure is bad since the user can't tell why they didn't get their book but it's troublesome to have to check all the exceptions when no book generated is expected from time to time. False Negatives desensitize the user. Ex. The Pocket plugin: The articles can be depleted by the user and if they don't refill it before the next scheduled download they get thrown exceptions, not clean errors. Currently I raise the exception but logging the problem and returning an empty list makes Calibre error out just as hard. |
05-10-2012, 12:23 AM | #2 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There's no way to fail silently. I can't think of any case where that is a good idea. Say you download from Pocket and nothing happens, how is that better than an error message telling you that download failed?
|
Advert | |
|
05-12-2012, 01:08 PM | #3 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I have added a method to fail and display a simple message to the user instead of an error dialog. http://bazaar.launchpad.net/~kovid/c...revision/12162
If you want to use it in your recipe and have your recipe remain compatible with older calibre versions, do this Code:
if hasattr(self, 'abort_recipe_processing'): self.abort_recipe_processing('Pocket download aborted as no new articles found') |
05-14-2012, 11:11 PM | #4 |
Enthusiast
Posts: 39
Karma: 10
Join Date: Feb 2012
Location: Las Vegas, NV
Device: nook Simple GlowLight
|
Thank you so very much for this feature!
I will get the plugin updated soon! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Installing ReaderLibrary 3.1 Silently | NexenInc | Sony Reader Dev Corner | 1 | 04-27-2010 10:22 AM |
Unable to download 04/21 update - fails silently :( | AB9239 | enTourage Archive | 4 | 04-25-2010 08:46 PM |
PRS-600 Accessing the display via /dev/fb fails silently... any ideas why? | Xaphiosis | Sony Reader Dev Corner | 10 | 04-22-2010 07:15 AM |
Help! I'm silently freaking out. | Ea | Reading Recommendations | 11 | 12-01-2009 09:54 AM |
ComicLRF fails silently from Gui | Cold | Calibre | 1 | 11-07-2008 03:16 PM |