@classmethod
def build(cls, pathname, min_results, max_results, got_results, or_more=False):
    """Build the message string

        .. note::
           All Exceptions must support being rebuilt from str(self), in order
           to transit from a process pool executor back to the main process
           through pickle/unpickle. This is why we can't just define __init__
           with all these arguments.

        :returns:
            new FileMatchError object
        """
    msg = "File match '%s' produced %d%s results, expected " % (pathname,
        got_results, ' or more' if or_more else '')
    if max_results is None:
        msg += 'at least %d' % min_results
    elif max_results == min_results:
        msg += 'exactly %d' % min_results
    elif min_results > 0:
        msg += 'between %d and %d' % (min_results, max_results)
    else:
        msg += 'up to %d' % max_results
    return cls(msg)
