XPLMSetErrorCallback

XPLM_API void       XPLMSetErrorCallback(
                         XPLMError_f          inCallback);

XPLMSetErrorCallback installs an error-reporting callback for your plugin. Normally the plugin system performs minimum diagnostics to maximize performance. When you install an error callback, you will receive calls due to certain plugin errors, such as passing bad parameters or incorrect data.

Important: the error callback determines programming errors, e.g. bad API parameters. Every error that is returned by the error callback represents a mistake in your plugin that you should fix. Error callbacks are not used to report expected run-time problems (e.g. disk I/O errors).

The intention is for you to install the error callback during debug sections and put a break-point inside your callback. This will cause you to break into the debugger from within the SDK at the point in your plugin where you made an illegal call.

Installing an error callback may activate error checking code that would not normally run, and this may adversely affect performance, so do not leave error callbacks installed in shipping plugins. Since the only useful response to an error is to change code, error callbacks are not useful “in the field”.