+def throw_notfound(method):
+ """Decorator to convert a 404 error into a cumulus.store.NoutFoundError."""
+ def f(*args, **kwargs):
+ try:
+ return method(*args, **kwargs)
+ except S3ResponseError as e:
+ if e.status == 404:
+ print "Got a 404:", e
+ raise cumulus.store.NotFoundError(e)
+ else:
+ raise
+ return f
+