Skip to content

Commit 6431e61

Browse files
committed
Don't suppress WebGL errors
1 parent 20ce115 commit 6431e61

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/render/program.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class Program<Us extends UniformBindings> {
9494
gl.compileShader(fragmentShader);
9595

9696
if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {
97-
throw new Error(`Could not compile fragment shader: ${gl.getShaderInfoLog(fragmentShader)}`);
97+
throw new Error(`WebGL: Could not compile fragment shader: ${gl.getShaderInfoLog(fragmentShader)}`);
9898
}
9999

100100
gl.attachShader(this.program, fragmentShader);
@@ -108,7 +108,7 @@ export class Program<Us extends UniformBindings> {
108108
gl.compileShader(vertexShader);
109109

110110
if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
111-
throw new Error(`Could not compile vertex shader: ${gl.getShaderInfoLog(vertexShader)}`);
111+
throw new Error(`WebGL: Could not compile vertex shader: ${gl.getShaderInfoLog(vertexShader)}`);
112112
}
113113

114114
gl.attachShader(this.program, vertexShader);
@@ -128,7 +128,7 @@ export class Program<Us extends UniformBindings> {
128128
gl.linkProgram(this.program);
129129

130130
if (!gl.getProgramParameter(this.program, gl.LINK_STATUS)) {
131-
throw new Error(`Program failed to link: ${gl.getProgramInfoLog(this.program)}`);
131+
throw new Error(`WebGL: Program failed to link: ${gl.getProgramInfoLog(this.program)}`);
132132
}
133133

134134
gl.deleteShader(vertexShader);

src/ui/map.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -3341,7 +3341,11 @@ export class Map extends Camera {
33413341
PerformanceUtils.frame(paintStartTimeStamp);
33423342
this._frameRequest = null;
33433343
this._render(paintStartTimeStamp);
3344-
}).catch(() => {}); // ignore abort error
3344+
}).catch((error: Error) => {
3345+
if (error.message.startsWith('WebGL:')) {
3346+
throw error;
3347+
}
3348+
}); // ignore abort error
33453349
}
33463350
}
33473351

0 commit comments

Comments
 (0)