def check_msg(msg):
    """
    Check if message contains Error or Warning for run_analysis functions.

    Args:
        msg (str): Message from server/client code

    Returns:
        err (bool): True for there is an error
        msg (str): Message informing the user if the program is running
                    properly or there is an error or warning.

    """
    err = bool(0)
    if 'Error' in msg:
        err = bool(1)
    elif "Warning" in msg:
        msg = 'Success! Warning: Image already exists. ' \
              'Processing ran on existing image'
    else:
        msg = 'Image saved successfully'
    return err, msg