def build_message(attr_name, val1, val2, details=""):
    """ Build error message for is_has_traits_almost_equal and
    is_val_almost_equal to return.
    """
    type1 = type(val1)
    type2 = type(val2)
    msg = "Different {} {}. Types: {} vs {}. Values: \n{} \nvs \n{}"
    msg = msg.format(attr_name, details, type1, type2, repr(val1), repr(val2))
    return msg