Sampling Exception Handling

Sampling libraries cannot raise exceptions, but you can specify a user notification event number if you want to subscribe to an exception in a sampling library.

If an error occurs in the sampling library, a user notification event is caused on the Node object in which the exception occurs. If you want to be notified of a sampling exception, subscribe to an exception in a sampling library by specifying the SamplingExceptionEvent number in the command parameter of the Node class logUserCommand method, in the following format.

SamplingExceptionEvent user-notification-event-number

In this format, the user-notification-event-number must be in the range User_Base_Event through User_Max_Event of the global constants in the UserEvents category, listed in the following table.

Global Constant Integer Value
User_Base_Event 16
User_Max_Event Max_Integer (#7FFFFFFF, equates to 2147483647)

If you subscribe to a sampling exception event by using the SamplingExceptionEvent and an exception occurs in the sampling library, an event is caused on the Node object to notify the subscriber that a sampling exception occurred. Sampling for that node is then terminated.

The userInfo parameter in the Object class userNotification or a userNotify event method of the Windows class or subclass is then set by the Class class causeClassEvent or Object class causeEvent method to one of the following values.

Sampling for the current session is terminated, regardless of whether an exception event was caused (that is, if you subscribed to a sampling exception by specifying a user notification event number in the command parameter of the Node class logUserCommand method or not).