shouldRetry abstract method
Whether the task should be retried
attempt is the current attempt number (0-based for first attempt).
error is the error that caused the failure.
stackTrace is the stack trace of the error.
Implementation
bool shouldRetry(int attempt, Object error, StackTrace stackTrace);