Make 'options(error = function(e) traceback(2))` optional in testJob
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 184
- Forks
- 53
- Avg merge
- 7d 2h
- Merged PRs (30d)
- 1
Description
I would like to run testJob() and drop to the debugger as soon as an error is thrown. However, the following prevents me from just having options(error=recover) do its work:
https://github.com/mllg/batchtools/blob/4c2a476725452e742ed59b9a45457723cd398ab2/R/execJob.R#L50-L51
Maybe you could make this line dependent on some setting, e.g. have an option(error.execjob) or something (default function(e) traceback(2L)) and then do
options(error = getOption("error.execjob", function(e) traceback(2L)))
(btw, it would probably also be cleaner to have the on.exi() happen before the options(error = ...) call).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in R/execJob.R at the testJob error-handling lines linked in the issue, and inspect how the current options(error = ...) and on.exit() calls are ordered. Make the error handler configurable while preserving the current traceback behavior by default; done means users can supply their own error option without it being overwritten.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100