Skip to content

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

@utkarshpawade

Description

@utkarshpawade

Description

Several parts of the codebase use a mix of stopifnot() and rlang::abort() for input validation. While abort() provides clear, user-friendly error messages, stopifnot() produces opaque messages that are harder for users to interpret.

This leads to inconsistent error handling and a less friendly user experience when validation fails.

Example

In helpers-ppc.R:

# Line 70
stopifnot(is.matrix(predictions), is.numeric(predictions))

# Line 85
abort("NAs not allowed in predictions.")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions