The GLU provides a routine for obtaining a descriptive string for an error code. For information about OpenGL's error handling facility, see "Error Handling." const GLubyte* gluErrorString(GLenum errorCode);
Returns a pointer to a descriptive string that corresponds to the OpenGL, GLU, or GLX error number passed in errorCode. The defined error codes are described in the OpenGLReference Manual along with the command or routine that can generate them.
OpenGL Programming Guide