![]() | ![]() | Programming Guide |
Installs an error handler
void sm_obj_onerror(char *handler);
handler- The name of the error handler. This C function or JPL procedure will be passed three parameters:
errorNumber- The error number as an integer. Use this value to test for errors.
errorHexidecimal- The error number as a string in hexadecimal format, as in
0x80000307. (This parameter is displayed by the default error handler.)errorMessage- The text description of the error. (This parameter is displayed by the default error handler.)
COM, EJB
Client
sm_obj_onerrorspecifies the error handler that will be called if an operation returns a negative exception. The return from the handler is ignored.An error handler will only be fired on negative exception codes; for COM/MTS applications, use
sm_com_resultto retrieve positive exceptions.If you do not want an error handler, you must install your own error handler that simple returns.
To restore the default error handler, use
sm_obj_onerror(0).
// This JPL module specifies an error handler
// similar to the default error handler.
call sm_obj_onerror (handler)
proc handler (errnum, errhex, errmsg)
msg emsg "COM Error: " errhex " " errmsg
return
![]()
![]()
![]()
![]()