def _handle_granularity_error(level):
    """
    Raises ValueError with detailed error message if one of the two situations is true:
      1. calculated granularity is less than minute (sec or ms)
      2. resampling is not enabled for situations where calculated granularity < min

      level : String
        the granularity that is below the min threshold
    """
    e_message = (
        '%s granularity is not supported. Ensure granularity => minute or enable resampling'
         % level)
    raise ValueError(e_message)
