Whether this task should be retried when the given exception occurs.

def should_retry_on(self, exception_class, logger=None):
        """
        Whether this task should be retried when the given exception occurs.
        """
        for n in (self.retry_on or []):
            try:
                if issubclass(exception_class, import_attribute(n)):
                    return True
            except TaskImportError:
                if logger:
                    logger.error('should_retry_on could not import class',
                                 exception_name=n)
        return False