Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 05-09-2012, 02:59 PM   #1
tBunnyMan
Enthusiast
tBunnyMan began at the beginning.
 
tBunnyMan's Avatar
 
Posts: 39
Karma: 10
Join Date: Feb 2012
Location: Las Vegas, NV
Device: nook Simple GlowLight
Question 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.
tBunnyMan is offline   Reply With Quote
Old 05-10-2012, 12:23 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 24,834
Karma: 4370273
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?
kovidgoyal is offline   Reply With Quote
Old 05-12-2012, 01:08 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 24,834
Karma: 4370273
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')
kovidgoyal is offline   Reply With Quote
Old 05-14-2012, 11:11 PM   #4
tBunnyMan
Enthusiast
tBunnyMan began at the beginning.
 
tBunnyMan's Avatar
 
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!
tBunnyMan is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 09:00 PM.


MobileRead.com is a privately owned, operated and funded community.