I'm using dogpile.cache in a Python project, with a pylibmc based backend. After creating a region I use something like:
@region.cache_on_arguments()
def run_some_query(**kwargs):
# ... Query code ...
return query_results
My problem is, that there are certain exceptions that the decorator raises, that I would simply like to ignore. For instance if memcached is not available, or if the result is too large.
Is there a way to achieve this without rolling my own custom decorator? And if I have to create a custom decorator, what is good way to achieve that.