Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kor::captureAll gives an incorrect error message "Error in ... : argument "calls" is missing, with no default" #12

Closed
k-barton opened this issue Apr 20, 2018 · 1 comment
Assignees
Labels
bug kor issue related to kor R package

Comments

@k-barton
Copy link
Owner

k-barton commented Apr 20, 2018

kor::captureAll outputs error message from restartError instead of the original one. This happens because no sys.calls() are passed to it (when doTraceback=TRUE).

Example:

:> test <- function(foo) `{
       on.exit(return(foo))
       stop("test error")
   }
   test(1)

Error in fun(quote(1)) : argument "calls" is missing, with no default

while the actual message should be:
Error: test error

@k-barton k-barton added the kor issue related to kor R package label Apr 20, 2018
@k-barton k-barton self-assigned this Apr 20, 2018
@k-barton k-barton added the bug label Apr 20, 2018
@k-barton
Copy link
Owner Author

Another test:

test <- function(foo) {
    on.exit({
        message("message on.exit")
        warning("test warn on.exit")
        return(foo)
    })
    print("pre warning")
    warning("test warn 1")
    warning("test warn 2")
    print("after warning")
    stop("test error")
    print(666)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug kor issue related to kor R package
Projects
None yet
Development

No branches or pull requests

1 participant