<commit_before>package openfl._internal.stage3D;

import openfl.errors.IllegalOperationError;
import openfl.gl.GL;


class GLUtils {

    private static var debug = false;

    // Comment the following line if you want the GL Error check in release mode on device
    //[Conditional("DEBUG")]

    public static function CheckGLError():Void
    {
        if (!debug) return;

        var error = GL.getError();
        if (error != GL.NO_ERROR) {
            throw new IllegalOperationError("Error calling openGL api. Error: " + error + "\n");
        }
    }

}<commit_msg>Print useful GL error messages.<commit_after>package openfl._internal.stage3D;

import openfl.errors.IllegalOperationError;
import openfl.gl.GL;


class GLUtils {
	
    private static var debug = false;
	
    // Comment the following line if you want the GL Error check in release mode on device
    //[Conditional("DEBUG")]
	
    public static function CheckGLError ():Void {
        if (!debug) return;

        var error = GL.getError ();
		
        if (error != GL.NO_ERROR) {
			
			var errorText = switch (error) {
				case GL.NO_ERROR:
					"GL_NO_ERROR";
				case GL.INVALID_ENUM:
					"GL_INVALID_ENUM";
				case GL.INVALID_OPERATION:
					"GL_INVALID_OPERATION";
				case GL.INVALID_FRAMEBUFFER_OPERATION:
					"GL_INVALID_FRAMEBUFFER_OPERATION";
				case GL.INVALID_VALUE:
					"GL_INVALID_VALUE";
				case GL.OUT_OF_MEMORY:
					"GL_OUT_OF_MEMORY";
				default:
					Std.string (error);
			};
			
            throw new IllegalOperationError("Error calling openGL api. Error: " + errorText + "\n");
			
        }
		
    }
	
}
{'fraction_non_alphanumeric': 0.09937888198757763, 'fraction_numerical': 0.0012422360248447205, 'mean_word_length': 2.6780821917808217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4422267', 'n_tokens_mistral': 562, 'n_tokens_neox': 480, 'n_words': 134}