DataException: The DataException hierarchy

Description Usage Arguments Value Functions See Also Examples

View source: R/DataExceptions.R

Description

DataExceptions and their sub-classes describe problems with data values, names, or formats. Subclasses extended the specificity of the DataException. Each takes a data argument and possibly others. See Exception. These exceptions are intended to be signaled, i.e. with stop and exist both to provide pre-defined error messages and so that handlers in try/catch blocks have latitude to choose what granularity of exception to catch.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
DataException(data = NA, message = "*", call = NULL,
  package = packageName(), ...)

FileFormatException(path = NA, line = NA, data = NA, message = "*",
  call = NULL, package = packageName(), ...)

EmptyFileException(path = NA, data = NA, line = NA, message = "*",
  call = NULL, package = packageName(), ...)

FileNotEmptyException(path = NA, data = NA, line = NA, message = "*",
  call = NULL, package = packageName(), ...)

Arguments

data

The data element associated with an exception. Format varies and should be described in subclass documentation. This may be NA but should not be NULL. Accessible via the the exceptionData S3 accessor.

message

The message associated with the exception, for reading by humans. The default message is usually good enough, but can be overridden through this parameter if needed. When constructed inside packages, the message displayed will have the name of the package prepended as '[package] message' due to conditionMessage being over-ridden for Exception subclasses.

call

The call or call stack associated with the exception. By default this is NUL. Can be overridden to provide the sys.calls call stack or a single sys.call.

package

The package where this exception is generated. May be NULL when exceptions are generated and signaled from interactive or script level code and not from a package. Attempts to guess the package by default. Will usually include the package in the displayed message.

...

Additional arguments defining arg= value data to include in the Exception (accessible as list elements, but preferably by S3 accessor functions).

path

The path associated with an exception, as a one element character vector This is required for a FileFormatException or sub-class. It may be NA but should not be NULL. Accessible via the the exceptionPath S3 accessor.

line

The line associated with an exception, as a one element integer vector This is required for a FileFormatException or sub-class. It may be NA but should not be NULL. Accessible via the the exceptionLine S3 accessor.

Value

An DataException or descendant describing some problematic event involving a data values, names, or formats. Always is/extends class c( "DataException", "Exception", "condition" ).

Functions

See Also

condition, conditionMessage(), conditionCall, Exception, exceptionPackage, exceptionData

Examples

1
2
3
4
5

jefferys/Exception documentation built on May 19, 2019, 3:59 a.m.