Skip to content

Commit

Permalink
Use tryCatch() correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
hsonne committed Nov 1, 2024
1 parent bbac39d commit 9b42762
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/extractObservationData.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extractObservationData <- function(
dbg = dbg
)
},
error = {
error = function(e) {
do.call(extractObservationData_2, c(dot.args, list(
text = text,
headerInfo = getHeaderInfo(text),
Expand Down
2 changes: 1 addition & 1 deletion R/readObservationsFromCsvText.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ readObservationsFromCsvText <- function(
utils::read.table, c(common_args, list(colClasses = colClasses))
),
silent = TRUE,
error = {
error = function(e) {
data <- do.call(utils::read.table, c(common_args, list(colClasses = NA)))
convertTypes(data, dbg = dbg, classes = sapply(
X = get_elements(inspectionDataFieldCodes(), names(data)),
Expand Down

0 comments on commit 9b42762

Please sign in to comment.