Skip to content

makeXFunctions does not throw correct error message if argument is missing #283

@tdeenes

Description

@tdeenes

makeAssertionFunction() and makeExpectationFunction() return empty character instead of the argument name if the argument is missing.

library(checkmate)
printErrMsg = function(expr) tryCatch(expr, error = function(e) print(conditionMessage(e)))
checkInt() |> printErrMsg()
# [1] "argument \"x\" is missing, with no default"
testInt() |> printErrMsg()
# [1] "argument \"x\" is missing, with no default"
assertInt() |> printErrMsg()
# [1] "argument \"\" is missing, with no default"
expect_int() |> printErrMsg()
[1] "Argument '' is missing"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions