Skip to content

Commit

Permalink
Merge pull request #6098 from chechenxu/chenxu/fes
Browse files Browse the repository at this point in the history
[FES] Replace throw error with FES
  • Loading branch information
davepagurek authored Apr 21, 2023
2 parents f721ae6 + b62930f commit 1316bcc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/webgl/loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ p5.prototype.loadModel = function(path) {
if (failureCallback) {
failureCallback();
} else {
console.error(
p5._friendlyError(
'Sorry, the file type is invalid. Only OBJ and STL files are supported.'
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/webgl/p5.Matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ p5.Matrix = class {
*/
inverseTranspose(matrix) {
if (this.mat3 === undefined) {
console.error('sorry, this function only works with mat3');
p5._friendlyError('sorry, this function only works with mat3');
} else {
//convert mat4 -> mat3
this.mat3[0] = matrix.mat4[0];
Expand Down
4 changes: 2 additions & 2 deletions src/webgl/p5.RendererGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ p5.prototype.setAttributes = function(key, value) {
if (!this._setupDone) {
for (const x in this._renderer.retainedMode.geometry) {
if (this._renderer.retainedMode.geometry.hasOwnProperty(x)) {
console.error(
p5._friendlyError(
'Sorry, Could not set the attributes, you need to call setAttributes() ' +
'before calling the other drawing methods in setup()'
);
Expand Down Expand Up @@ -755,7 +755,7 @@ p5.RendererGL.prototype.filter = function(filterType) {
// filter can be achieved using custom shaders.
// https://github.com/aferriss/p5jsShaderExamples
// https://itp-xstory.github.io/p5js-shaders/#/
console.error('filter() does not work in WEBGL mode');
p5._friendlyError('filter() does not work in WEBGL mode');
};

p5.RendererGL.prototype.blendMode = function(mode) {
Expand Down
6 changes: 3 additions & 3 deletions src/webgl/p5.Shader.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ p5.Shader = class {
gl.compileShader(this._vertShader);
// if our vertex shader failed compilation?
if (!gl.getShaderParameter(this._vertShader, gl.COMPILE_STATUS)) {
console.error(
p5._friendlyError(
`Yikes! An error occurred compiling the vertex shader:${gl.getShaderInfoLog(
this._vertShader
)}`
Expand All @@ -77,7 +77,7 @@ p5.Shader = class {
gl.compileShader(this._fragShader);
// if our frag shader failed compilation?
if (!gl.getShaderParameter(this._fragShader, gl.COMPILE_STATUS)) {
console.error(
p5._friendlyError(
`Darn! An error occurred compiling the fragment shader:${gl.getShaderInfoLog(
this._fragShader
)}`
Expand All @@ -90,7 +90,7 @@ p5.Shader = class {
gl.attachShader(this._glProgram, this._fragShader);
gl.linkProgram(this._glProgram);
if (!gl.getProgramParameter(this._glProgram, gl.LINK_STATUS)) {
console.error(
p5._friendlyError(
`Snap! Error linking shader program: ${gl.getProgramInfoLog(
this._glProgram
)}`
Expand Down

0 comments on commit 1316bcc

Please sign in to comment.