Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FES] Replace throw error with FES #6098

Merged
merged 1 commit into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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