human
Write me a the Python program you requested given the following:
Complete the below
def json_view(f):

    ''''Ensure the response content is well-formed JSON.
    Views wrapped in @json_view can return JSON-serializable Python objects,
    like lists and dicts, and the decorator will serialize the output and set
    the correct Content-type.
    Views may also throw known exceptions, like Http404, PermissionDenied,
    etc, and @json_view will convert the response to a standard JSON error
    format, and set the status code and content type.'
    '''
assistant
#Here is the Python program you requested.
    @wraps(f)
    def _wrapped(req, *a, **kw):
        try:
            ret = f(req, *a, **kw)
            blob = json.dumps(ret)
            return http.HttpResponse(blob, content_type=JSON)
        except http.Http404 as e:
            blob = json.dumps({'success': False, 'error': 404, 'message': str(e)})
            return http.HttpResponseNotFound(blob, content_type=JSON)
        except PermissionDenied as e:
            blob = json.dumps({'success': False, 'error': 403, 'message': str(e)})
            return http.HttpResponseForbidden(blob, content_type=JSON)
        except Exception as e:
            blob = json.dumps({'success': False, 'error': 500, 'message': str(e)})
            return http.HttpResponseServerError(blob, content_type=JSON)
    return _wrapped