def translate_snapshot_exception(method):
 def wrapper(self, ctx, snapshot_id, *args, **kwargs):
  try:
   res = method(self, ctx, snapshot_id, *args, **kwargs)
  except (keystone_exception.NotFound, cinder_exception.NotFound):
   _reraise(exception.SnapshotNotFound(snapshot_id=snapshot_id))
  return res
 return translate_cinder_exception(wrapper)

def translate_snapshot_exception ( method ) : def wrapper ( self , ctx , snapshot_id , * args , ** kwargs ) : try : res = method ( self , ctx , snapshot_id , * args , ** kwargs ) except ( keystone_exception . NotFound , cinder_exception . NotFound ) : _reraise ( exception . SnapshotNotFound ( snapshot_id = snapshot_id ) ) return res return translate_cinder_exception ( wrapper )
transforms the exception for the snapshot but keeps its traceback intact .