seasonder_skip_cs_file | R Documentation |
This function serves as a restart for seasonder_readSeaSondeCSFile
. When invoked, it provides a
mechanism to gracefully handle file reading errors by logging an error message and skipping the current file processing.
seasonder_skip_cs_file(cond)
cond |
The condition or error that occurred during the file reading process. This is used to log a detailed error message indicating the reason for skipping the file. |
This function is meant to be used within a custom condition handler. When a problematic condition
arises during the processing of a SeaSonde CS file, you can call seasonder_skip_cs_file(cond)
to
trigger this restart, which allows for a graceful degradation by logging an error message and returning a specified value.
The effect of invoking this restart is twofold:
An error message detailing the reason for skipping the file is logged.
The calling function (seasonder_readSeaSondeCSFile
) will immediately return a list with header = NULL
and data = NULL
.
A list with header = NULL and data = NULL.
# Example: Skip file reading using a withRestarts handler to return NULL header and data
result <- withRestarts(
seasonder_skip_cs_file(simpleError("test error")),
seasonder_skip_cs_file = function(cond) list(header = NULL, data = NULL)
)
print(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.