Skip to content

Commit 4d91b0c

Browse files
committed
Update utils.R
1 parent eec7dd5 commit 4d91b0c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

R/utils/utils.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ const echo_warning = function(msg, app = NULL, ssid = NULL) {
1515
msg = `[${app_name}] ${msg}`;
1616
}
1717

18-
print(msg);
19-
warning(msg);
18+
warning(msg, immediate.=TRUE);
2019
writeLines(msg, con = link);
2120
close(link);
2221
}
@@ -25,11 +24,14 @@ const echo_warning = function(msg, app = NULL, ssid = NULL) {
2524
#'
2625
#' @details a wrapper of the ``stop`` function.
2726
#'
28-
const throw_err = function(msg) {
27+
const throw_err = function(msg, app = NULL, ssid = NULL) {
28+
let error_log = `${.get_context(ssid)$temp_dir}/error`;
29+
2930
msg <- unlist(msg);
3031

3132
print("workflow error:");
3233
print(msg);
34+
writeLines(msg, con = error_log);
3335

3436
.Internal::stop(msg);
3537
}

0 commit comments

Comments
 (0)