Skip to content

Commit

Permalink
Improve error handling when importing data
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrerebeau committed Dec 12, 2023
1 parent f114e2c commit 31b98d6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/module_import.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
)
}

0 comments on commit 31b98d6

Please sign in to comment.