Skip to content

replace stopifnot() with abort() and descriptive messages in helpers …#472

Closed
utkarshpawade wants to merge 3 commits intostan-dev:masterfrom
utkarshpawade:stopifnot_abortmix
Closed

replace stopifnot() with abort() and descriptive messages in helpers …#472
utkarshpawade wants to merge 3 commits intostan-dev:masterfrom
utkarshpawade:stopifnot_abortmix

Conversation

@utkarshpawade
Copy link
Contributor

Fixes #471

This PR improves user-facing input validation in the following files:

  • helpers-ppc.R
  • helpers-mcmc.R
  • mcmc-diagnostics.R

Replaces all stopifnot() checks with explicit if + rlang::abort() calls.
Provides clear, descriptive error messages for invalid user input while ensuring consistent error handling across the codebase.

Why ?

stopifnot() produces opaque error messages that are difficult for users to interpret. Replacing these with abort() improves the user experience by making validation failures clearer and easier to understand.

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.

Inconsistent Input Validation: stopifnot() vs abort() in helper functions

1 participant