Exit status

Purpose: Set handler exit status.

 exit-status <request status>

exit-status specifies <request status>, which must be a number; this is the status that is passed out of the request to the external caller (see request and exit-handler).

<request status> can be obtained with "exit-status" clause in read-remote in the service caller; when the program runs as command-line, <request status> is program's exit code.

exit-status can be specified anywhere in the code, and does not mean exiting the request's processing; to do that, either use exit-handler or simply allow the handler to reach its end. If your program encounters difficulties and errors out, then the <request status> is always a fixed reserved value of 107, regardless of you setting it with exit-status.

When exit-status is not used, the default exit code is 0. When multiple exit-status statements run in a sequence, the request status is that of the last one that executes.

If you want to specify request status and exit request processing at the same time, use exit-handler.
Examples
When the program exits, its exit code will be 12:
 exit-status 12
 ...
 exit-handler



Copyright (c) 2019-2025 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.