<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def resolwe_exception_handler(exc, context):
 """Handle exceptions raised in API and make them nicer. To enable this, you have to add it to the settings: .. code:: python REST_FRAMEWORK = { 'EXCEPTION_HANDLER': 'resolwe.flow.utils.exceptions.resolwe_exception_handler', } """

    response = exception_handler(exc, context)

    if isinstance(exc, ValidationError):
        if response is None:
            response = Response({})
        response.status_code = 400
        response.data['error'] = exc.message

    return response