warnUser: Warning tracking

View source: R/errorLogging.R

warnUserR Documentation

Warning tracking

Description

Declares a warning to be of class "userWarning", to distinguish between warnings we programmed into the system (e.g. "Found extra meta data") and errors R gives (e.g. "argument has length >1")

Usage

warnUser(message)

Arguments

message

The warning message that the user should see

Details

Adds the class "userWarning" to the warning object.

All helpful errors should be thrown using warnUser. Any warning thrown using warning will be treated as an internal warning by the simple experiment loader.

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


mcneilco/racas documentation built on May 4, 2024, 9:53 p.m.