Catch error from R function

Open
#277 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp, r
Domain
api

Research direction

Start from the cpp11::package("base")["log"] entry point and review how cpp11 evaluates the R function when x is the character "a". Determine whether the interface exposes the error condition for modification or forwarding to another R function; done means establishing and documenting the supported behavior.

Written by the indexing model from the issue text.

Description

Is it possible to evaluate an R function and in case of an error catch the error condition and modify it?

For example I want to evaluate log() on x but x is the character "a"

auto log = cpp11::package("base")["log"];
log(x);

Can I catch the error with cpp11 and modify it or pass it to another R function?

Dominant language
C++
Stars
224
Forks
52
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from r-lib/cpp11

All issues in r-lib/cpp11

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.