human
I wrote the below code

    def wrapped(request, *args, **kwargs):
        use_json = (request.is_ajax() or request.META.get('HTTP_ACCEPT', '').startswith('application/json'))
        try:
            return func(request, *args, **kwargs)
        except User.DoesNotExist:
            message = _('User    does    not    exist.')
        except (AlreadyRunningError, QueueConnectionError) as err:
            message = str(err)
        if use_json:
            return JsonResponseBadRequest(message)
        else:
            return HttpResponseBadRequest(message)
    return wrapped

What's a good function header?
assistant
#Here's a good function header.

def common_exceptions_400(func):