stopUser: Fatal error tracking

View source: R/errorLogging.R

stopUserR Documentation

Fatal error tracking

Description

Declares an error to be of class userStop, to distinguish between errors we programmed into the system (e.g. "Unrecognized scientist") and errors R gives (e.g. "object not found")

Usage

stopUser(message)

stopUserWithTime(logFileName)

stopUserAndLogInvalidJSON(logName, logFileName, url, response, method = "GET",
  postfields = NULL)

Arguments

message

The error message that the user should see

Details

Stops the function, and adds the class "userStop" and "userError" to the error object

All errors intended for users to view should be thrown using stopUser. Any error thrown using stop will be treated as an internal error by the simple experiment loader.

When using this function, it is important to give it a single string as an error message. This means using paste. While stop("text ", variable, " text") is okay syntax, you will get an error if you try stopUser("text ", variable, " text"). Use paste0 instead: stopUser(paste0("text ", variable, " text")) (note that this syntax is also perfectly acceptable inside stop)


mcneilco/racas documentation built on Aug. 30, 2024, 9:27 p.m.