Standardize PPC error handling by replacing stop() with rlang abort()#456
Merged
jgabry merged 3 commits intostan-dev:masterfrom Mar 13, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes error handling in the PPC censoring and interpolation helpers by replacing the last remaining base stop() validations with rlang::abort(), aligning these code paths with the package’s prevailing structured error approach (Fixes #455).
Changes:
- Replaced
stop()withabort()for input validation inppc_km_overlay(). - Replaced
stop()withabort()for interpolation feasibility checks inget_interpolation_values(). - Documented the consistency change in
NEWS.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| R/ppc-censoring.R | Switches ppc_km_overlay() validation errors from stop() to abort(). |
| R/helpers-ppc.R | Switches interpolation validation errors in get_interpolation_values() from stop() to abort(). |
| NEWS.md | Adds a development NEWS entry describing the standardized error handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
77df0d8 to
96eb581
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #456 +/- ##
=======================================
Coverage 98.55% 98.55%
=======================================
Files 35 35
Lines 5864 5864
=======================================
Hits 5779 5779
Misses 85 85 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #455
This PR replaces the remaining base
stop()calls in PPC code paths withrlang::abort()to align with existing package conventions for structured error handling.What changed
ppc_km_overlay()to useabort()get_interpolation_values()to useabort()Why
bayesplotalready usesabort()in most places. This change removes inconsistency in error handling and improves maintainability without changing intended functionality.