Any RealSystem component can report errors to RealSystem. On a RealSystem client, these error messages display in a pop-up dialog box. On RealServer, the errors are recorded in the system error log file, the location and name of which is determined by the ErrorLogPath
parameter in the RealServer configuration file. Through the RealSystem interfaces, a component can also monitor system error messages.
![]() |
Note |
---|
A monitor plug-in can monitor the RealServer registry for client connections and other conditions that are not errors. See "Appendix F: RealServer Property Registry". |
A RealSystem component implements or uses the following error reporting interfaces:
IRMAErrorMessages
. Header file: rmaerror.h
. RealSystem implements this interface, which any RealSystem component can use to report errors.
IRMAErrorSinkControl
. Header file: rmaerror.h
. RealSystem implements this interface, which any RealSystem component can use to register as an error sink and receive notice of system errors.
IRMAErrorSink
. Header file: rmaerror.h
. A RealSystem component implements this interface to receive notice of system errors.
The header file pnresult.h
defines the status codes used in many RealSystem function calls as well as the system error messages. In normal operation, all RealSystem components need to be able to handle the following basic codes that may be returned by the RealSystem system:
PNR_FAIL
Operation failed.
PNR_OK
Operation succeeded.
PNR_UNEXPECTED
Call was unexpected or method is not implemented.
See the pnresult.h file for the status codes that a RealSystem component may receive or return. A component can call IRMAErrorMessages::GetErrorText
to get a text description of a status code. The method takes a status code as a parameter and returns a pointer to an IRMABuffer
interface that contains the status code text.
Any RealSystem component can report an error to RealSystem (RealServer or client). RealServer logs errors in its system error log. RealSystem clients report errors in a pop-up dialog box but typically do not record error messages on the client computer or upload them to the system log. To report errors, a component calls IRMAErrorMessages::Report
, which takes the following parameters:
unSeverity
Relative error severity, which affects how the system reacts. For any level of error, the RealSystem client may pop up a dialog box, depending on how the top-level client is implemented.
ulRMACode
RealSystem status code, which is translated to a text reason for display in the client error dialog box or RealServer log file. A component can call IRMAErrorMessages::GetErrorText
to get the code's text description. This method, which takes a status code such as PNR_OK
as a parameter, returns a pointer to an IRMABuffer
interface containing the status code text.
ulUserCode
Component-specific error code that is not translated to a text representation. It can have any value that is logged (RealServer) or displayed (client) without further interpretation.
pUserString
Component-specific error string that gives a text explanation of the component-specific error code. The string is logged (RealServer) or displayed (client) without further interpretation.
pMoreInfoURL
Component-specific "more information" URL string used, typically, only on the client. Pop-up error messages on RealPlayer, for example, contain a URL that directs the user to a http://www.real.com page that explains the error.
A RealSystem component on RealServer or the client can receive notice of system errors by registering as an error sink:
IRMAErrorSinkControl::AddErrorSink
to register itself as an error sink. The method passes to the system context a pointer to the component as the IRMAErrorSink
interface. It also passes two integer values, unLowSeverity
and unHighSeverity
, which have error severity levels as values. If, for example, the method call designates low as 0
and high as 2
, the component receives messages only for errors of severity 0
, 1
, or 2
.
IRMAErrorSink::ErrorOccurred
, passing the component the values for IRMAErrorMessages::Report
described previously in the error reporting section.
IRMAErrorSinkControl::RemoveErrorSink
.
The sample logging plug-in /samples/intermed/exlogpln/exlogpln.cpp
demonstrates how to get error messages using
IRMAErrorSink
and write them to a log file named exlog.log.
![]() |
Additional Information |
---|
For details about creating plug-ins, such as error-logging plug-ins, see "Chapter 4: Development Framework". |