From 31b98d69073e313d0449c3cc4fbd418bdffe0f23 Mon Sep 17 00:00:00 2001 From: nfrerebeau Date: Tue, 12 Dec 2023 18:54:35 +0100 Subject: [PATCH] Improve error handling when importing data --- R/module_import.R | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/R/module_import.R b/R/module_import.R index 84a21af..32cf68c 100644 --- a/R/module_import.R +++ b/R/module_import.R @@ -157,8 +157,12 @@ read_table <- function(path, header = TRUE, sep = ",", dec = ".", quote = "\"'", comment.char = comment.char) }, error = function(e) { - ## Return a safeError if a parsing error occurs - stop(safeError(e)) + showModal(modalDialog( + conditionMessage(e), + title = "Data import failed!", + easyClose = TRUE + )) + return(NULL) } ) }