<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def exception_translation(func):
 """ Catch exception and build correct api response for it. """

    @wraps(func)
    def decorator(*arg, **kwargs):
        try:
            return func(*arg, **kwargs)
        except InvalidOperationException, e:
            return Response(status=status.HTTP_412_PRECONDITION_FAILED, data={'detail': e.message}, headers={'Content-Type': 'application/json'})
    return decorator