Skip to content

Bug: Errors not captured in log files when using logrx::axecute() #270

@AbhaySThakur

Description

@AbhaySThakur

What happened?

When using logrx::axecute() to run R code that generates errors, these errors appear in the console but are not being captured in the log files.

Session Information

No response

Reproducible Example

I have system issues generating reprex render on my workspace but will share the reprex ready code.

Below in a simplified snippet of the code that you can run to reproduce the issue. It generates errors in console not captured by logrx in log files.

# Temporary work area
tmpDir <- tempdir()
rcode <- file.path(tmpDir, "test.R")
rlog  <- file.path(tmpDir, "test.log")

# Write code that will generate an error to the test file
writeLines("tibble::tibble(a = 1)[,NA]", con = rcode)

# Execute the code - error appears in console but not in log
logrx::axecute(rcode)

console output

Image

error log section screenshot which is empty

Image

The issue happens in logrx::write_errors function, it expects error text to be present in errors$message while that element is empty for this type of errors.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions