def raise_500(instance, msg=None):
    """Abort the current request with a 500 (Internal Server Error) response
    code. If the message is given it's output as an error message in the
    response body (correctly converted to the requested MIME type).

    :param instance: Resource instance (used to access the response)
    :type instance: :class:`webob.resource.Resource`
    :raises: :class:`webob.exceptions.ResponseException` of status 500
    """
    instance.response.status = 500
    if msg:
        instance.response.body_raw = {'error': msg}
    raise ResponseException(instance.response)
Abort the current request with a 500 (Internal Server Error) response
    code. If the message is given it's output as an error message in the
    response body (correctly converted to the requested MIME type).

    :param instance: Resource instance (used to access the response)
    :type instance: :class:`webob.resource.Resource`
    :raises: :class:`webob.exceptions.ResponseException` of status 500