Skip to content

Conversation

@hadley
Copy link
Member

@hadley hadley commented Oct 8, 2025

And improve docs to correctly calculate failure probabiltiies

And improve docs to correctly calculate failure probabiltiies
@claude
Copy link

claude bot commented Oct 8, 2025

Claude finished @hadley's task —— View job


Code Review

  • Read and analyze all changed files
  • Review error handling logic
  • Check documentation accuracy
  • Provide feedback

Issues found:

  1. Documentation calculation error in R/try-again.R:20,23: The failure probability calculations are wrong. For a 10% failure rate function:

    • try_again(1, ...) gives 10% × 10% = 1% failure (not 1% as claimed)
    • try_again(2, ...) gives 10% × 10% × 10% = 0.1% failure (not 0.1% as claimed)

    Should be try_again(times - 1, ...) for the documented probabilities.

  2. Logic improvement: Error handling now properly distinguishes expectation failures from other errors, which is good.

@hadley hadley merged commit e4b98d5 into main Oct 8, 2025
14 checks passed
@hadley hadley deleted the try-again-error branch October 8, 2025 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant