Sometimes it takes a long time of inserting conditional prints and checks to glGetError()
to narrow down using a form of binary search where the first function call
BuGLe sounds like it will do what you want:
glGetError
after each call to check for errors, and wrap glGetError so that this checking is transparent to your program.