human
Complete this python program:
def catch_processing_exceptions(func):
assistant
#Here is the Python program you requested.

    """Decorator that catches :exc:`ProcessingException`s and subsequently
    returns a JSON-ified error response.
    """
    @wraps(func)
    def new_func(*args, **kw):
        'Executes    ``func(*args,    **kw)``    but    catches\n                                :exc:`ProcessingException`s.\n\n                                '
        try:
            return func(*args, **kw)
        except ProcessingException as exception:
            kw = dict(((key, getattr(exception, key)) for key in ERROR_FIELDS))
            kw['code'] = kw.pop('code_')
            return error_response(cause=exception, **kw)
    return new_func