I have a bunch of NT services written with VAST 5.5.2. Some of them can detect an error with MS/SQL. At that point I want to exit with an error code so Windows will treat the exit as a failure and restart the service. The hope is that the error will go away. The following code is called to exit:
- Code: Select all
System exit: -99 withObject: nil
It seems to work fine but the text log contains a stack trace of a few lines, basically complaining about the error exit. This isn't a big deal but it would be nice not to have these extra lines in the log. The code ends up calling the following:
- Code: Select all
primitiveExit: errorCode withObject: anObject
"Exit the image without shutting it down."
<primitive: VMprSystemConfigurationPrimitiveExitWithObject>
^self primitiveFailed
As you can see it calls a primitive, so I can't tell if there are any circumstances that would exit without the stack trace. I have looked through SystemPrimitiveErrors and found PrimErrInternalError, that I could use instead of -99 if it would exit without the stack trace. When I execute:
- Code: Select all
System exit: -99 withObject: nil
- Code: Select all
System exit: SystemPrimitiveErrors::PrimErrInternalError withObject: nil
Thanks, Lou