If the decorated function raises exception exc_type, allow num_retries retry attempts before raise the exception.