def translate_mixed_exceptions(method):
 def wrapper(self, ctx, res_id, *args, **kwargs):
  try:
   res = method(self, ctx, res_id, *args, **kwargs)
  except (keystone_exception.NotFound, cinder_exception.NotFound):
   _reraise(exception.VolumeNotFound(volume_id=res_id))
  except cinder_exception.OverLimit:
   _reraise(exception.OverQuota(overs='snapshots'))
  return res
 return translate_cinder_exception(wrapper)

def translate_mixed_exceptions ( method ) : def wrapper ( self , ctx , res_id , * args , ** kwargs ) : try : res = method ( self , ctx , res_id , * args , ** kwargs ) except ( keystone_exception . NotFound , cinder_exception . NotFound ) : _reraise ( exception . VolumeNotFound ( volume_id = res_id ) ) except cinder_exception . OverLimit : _reraise ( exception . OverQuota ( overs = 'snapshots' ) ) return res return translate_cinder_exception ( wrapper )
transforms exceptions that can come from both volumes and snapshots .