GR_ERROR_FUNC GrSetErrorHandler ( GR_ERROR_FUNC func );
The GrSetErrorHandler function sets an error handling function that the server calls whenever an error occurs while the client has requested an event.
If you set func to zero, the server then calls a default routine, GrDefaultErrorHandler.
When an error occurs, the server calls the error handling function is called with the parameters GR_ERROR, GR_FUNC_NAME, and GR_ID. These are the error code, the name of the function which failed, and a resource id, which is set to zero if there is no meaningful resource ID. The error routine can return if desired, but without corrective action new errors will probably occur.