File: Tutorial.ErrorCodes.txt

package info (click to toggle)
openni 1.5.4.0%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 45,580 kB
  • sloc: cpp: 116,706; ansic: 58,807; sh: 10,287; cs: 7,698; java: 7,402; python: 1,547; makefile: 492; xml: 167
file content (24 lines) | stat: -rw-r--r-- 827 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
@page error_codes Error codes

OpenNI errors mechanism is error codes. Every function that might fail has a return value of type @ref XnStatus.
A value of XN_STATUS_OK means the function has succeeded. Any other value means some kind of failure
has occurred.

For additional error information, one may use the function @ref xnGetStatusString(), which returns a human
readable description of the error, in English.

Some basic error codes can be found in file XnStatusCodes.h.

A normal usage of the error mechanism is checking if an error has occurred, and if so, print a message
and close the application:
@code
xn::Context context;
XnStatus nRetVal = context.Init();
if (nRetVal != XN_STATUS_OK)
{
	printf("Failed to initialize OpenNI: %s\n", xnGetStatusString(nRetVal));
	exit(-1);
}
@endcode
*/