checkGlErrorOrThrow

Checks the gl error and throw.