Skip to content

Commit

Permalink
Fixed stderr messaging. only shows if non empty for footnote addition
Browse files Browse the repository at this point in the history
  • Loading branch information
mduncans committed Oct 31, 2024
1 parent 7e5e0d8 commit 0cfa6e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/add_footnotes.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ add_footnotes <- function(docx_in,
result <- processx::run(
command = uv_path, args = fig_args, env = c("current", VIRTUAL_ENV = venv_path), error_on_status = TRUE
)
if (length(result$stderr) != 0) {
if (nzchar(result$stderr)) {
log4r::warn(.le$logger, paste0("Figure footnotes script stderr: ", result$stderr))
}
}, error = function(e) {
Expand All @@ -152,7 +152,7 @@ add_footnotes <- function(docx_in,
result <- processx::run(
command = uv_path, args = tab_args, env = c("current", VIRTUAL_ENV = venv_path), error_on_status = TRUE
)
if (length(result$stderr) != 0) {
if (nzchar(result$stderr)) {
log4r::warn(.le$logger, paste0("Table footnotes script stderr: ", result$stderr))
}
}, error = function(e) {
Expand Down
2 changes: 1 addition & 1 deletion R/build_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ build_report <- function(docx_in,
)
})
}, error = function(e) {
log4r::error(.le$logger, paste("Figure footnotes script failed:", e$message))
log4r::error(.le$logger, paste("Footnotes scripts failed:", e$message))
stop("build_report stopped: Failed to add footnotes due to an error in add_footnotes.", call. = FALSE)
})
}
Expand Down

0 comments on commit 0cfa6e3

Please sign in to comment.