def _get_error_message(check, threshold, importance, series_name, value):
    """
    Construct a check's error message, which will differ based on the number of
    consecutive failed points.

    For a single failed point:

        Format:   <importance> <series_name>: <value> not <comparator> <threshold>
        Example:  WARNING foo.service.errors: 100 not < 50

    For N consecutive failed points:

        Format:   <importance> <series_name>: <N> consecutive points not <comparator> <threshold>
        Example:  CRITICAL foo.service.errors: 10 consecutive points not < 50

    """
    if check.consecutive_failures == 1:
        fmt = u'{} {}: {:0.1f} not {} {:0.1f}'
        return fmt.format(importance, series_name, value, check.check_type, threshold)
    else:
        fmt = u'{} {}: {} consecutive points not {} {:0.1f}'
        return fmt.format(importance, series_name, check.consecutive_failures,
                          check.check_type, threshold)