From b296552e353beebdeff88d17fbac048d983f8c4b Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Wed, 27 May 2020 01:08:02 +0200 Subject: [PATCH] error logging --- src/ext/lib/ar-detect/AardGl.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ext/lib/ar-detect/AardGl.js b/src/ext/lib/ar-detect/AardGl.js index 6d2315c..7d855f0 100644 --- a/src/ext/lib/ar-detect/AardGl.js +++ b/src/ext/lib/ar-detect/AardGl.js @@ -224,8 +224,8 @@ class AardGl { // check if shader was compiled successfully if (! glContext.getShaderParameter(shader, this.gl.COMPILE_STATUS)) { + this.logger.log('error', ['init', 'debug', 'arDetect'], `%c[AardGl::setupShader] <@${this.arid}> Failed to setup shader. Error given:`, glContext.getShaderInfoLog(), _ard_console_stop); glContext.deleteShader(shader); - this.logger.log('error', ['init', 'debug', 'arDetect'], `%c[AardGl::setupShader] <@${this.arid}> Failed to setup shader.`, _ard_console_stop); return null; } @@ -245,8 +245,7 @@ class AardGl { } glContext.linkProgram(program); if (! glContext.getProgramParameter(program, glContext.LINK_STATUS)) { - glContext.deleteShader(shader); - this.logger.log('error', ['init', 'debug', 'arDetect'], `%c[AardGl::setupProgram] <@${this.arid}> Failed to setup program.`, _ard_console_stop); + this.logger.log('error', ['init', 'debug', 'arDetect'], `%c[AardGl::setupProgram] <@${this.arid}> Failed to setup program.`, glContext.getProgramInfoLog(), _ard_console_stop); return null; }