COMStop: General Error function for COM errors

View source: R/COMError.R

COMStopR Documentation

General Error function for COM errors

Description

This is a general function for raising an exception in a DCOM computation from within R. It takes a message and a status code (an integer from the DCOM operation) and raises an error. The class of the error can be specified allowing for different types of errors to be distinguished. It is the ability to specify the class of the error that makes this general.

Usage

COMStop(msg, status, class)

Arguments

msg

a message string to display in the error, intended to be human readable.

status

an integer that identifies the type of the DCOM error. These are interpreted relative to a table of errors. We should make this available from the R language by accessing the C structures.

class

a character vector giving the name of the class(es) for the error being created. One can specify different class names to allow error handlers to easily differentiate between types of errors using tryCatch.

Details

This uses the exception mechanism in R to provide extensible error objects that can be caught in a flexible manner.

Value

An error object of the class specified by class.

Author(s)

Duncan Temple Lang <duncan@r-project.org>

References

http://www.omegahat.net/RDCOMServer http://www.omegahat.net/RDCOMClient

See Also

.COM

Examples

## Not run: 
   COMStop("A fake error message", 1, "FakeCOMError")

## End(Not run)

omegahat/RDCOMClient documentation built on July 24, 2022, 5:45 a.m.