import logging


def _check_api_error_message(json_data):
    """
    Returns an error if one occurred and an empty string if the response
    was successful

    json_data -- the data returned from the UW API query
    """
    #Ensure the response was received
    status_code = json_data['meta']['status']

    logging.info("Status code from UW API response is: {}".format(status_code))

    #Notify  if there are errors
    if status_code is not 200:
        error_message = json_data['meta']['message']
        return error_message

    return ""