Skip to content

Commit

Permalink
unify error messages
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87853 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
ripley committed Mar 1, 2025
1 parent f404ec5 commit 3985bc5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/coerce.c
Original file line number Diff line number Diff line change
Expand Up @@ -1829,15 +1829,15 @@ Rboolean asRbool(SEXP x, SEXP call)
{
int ans = asLogical2(x, 1, call);
if (ans == NA_LOGICAL)
errorcall(call, _("NA in coercion to Rboolean"));
errorcall(call, _("NA in coercion to boolean"));
return (Rboolean) ans;
}

bool asBool2(SEXP x, SEXP call)
{
int ans = asLogical2(x, 1, call);
if (ans == NA_LOGICAL)
errorcall(call, _("NA in coercion to bool"));
errorcall(call, _("NA in coercion to boolean"));
return (bool) ans;
}

Expand All @@ -1846,15 +1846,15 @@ Rboolean asRboolean(SEXP x)
{
int ans = asLogical2(x, 1, R_NilValue);
if (ans == NA_LOGICAL)
error(_("NA in coercion to Rboolean"));
error(_("NA in coercion to boolean"));
return (Rboolean) ans;
}

bool asBool(SEXP x)
{
int ans = asLogical2(x, 1, R_NilValue);
if (ans == NA_LOGICAL)
error(_("NA in coercion to bool"));
error(_("NA in coercion to boolean"));
return (bool) ans;
}

Expand Down

0 comments on commit 3985bc5

Please sign in to comment.