Skip to content

Commit 1b79ed6

Browse files
authored
Merge pull request #2141 from processing/friendly-err-sys
Temporarily disabling CSS for FES
2 parents 4449d63 + 831c982 commit 1b79ed6

File tree

1 file changed

+15
-23
lines changed

1 file changed

+15
-23
lines changed

src/core/error_helpers.js

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,14 @@ function report(message, func, color) {
5858
}
5959
if (func.substring(0,4) === 'load'){
6060
console.log(
61-
'%c> p5.js says: '+message+'%c'+
62-
'[https://github.com/processing/p5.js/wiki/Local-server]',
63-
'background-color:' + color + ';color:#FFF;',
64-
'background-color:transparent;color:' + color +';',
65-
'background-color:' + color + ';color:#FFF;',
66-
'background-color:transparent;color:' + color +';'
61+
'> p5.js says: '+message+
62+
'[https://github.com/processing/p5.js/wiki/Local-server]'
6763
);
6864
}
6965
else{
7066
console.log(
71-
'%c> p5.js says: '+message+'%c [http://p5js.org/reference/#p5/'+func+
72-
']', 'background-color:' + color + ';color:#FFF;',
73-
'background-color:transparent;color:' + color +';'
67+
'> p5.js says: '+message+' [http://p5js.org/reference/#p5/'+func+
68+
']'
7469
);
7570
}
7671
}
@@ -103,7 +98,7 @@ p5._friendlyFileLoadError = function (errorType, filePath) {
10398
var errorInfo = errorCases[ errorType ];
10499
var message = 'It looks like there was a problem' +
105100
' loading your ' + errorInfo.fileType + '.' +
106-
' Try checking if the file path%c [' + filePath + '] %cis correct,' +
101+
' Try checking if the file path [' + filePath + '] is correct,' +
107102
(errorInfo.message || '') + ' or running a local server.';
108103
report(message, errorInfo.method, FILE_LOAD);
109104
};
@@ -239,7 +234,7 @@ p5._friendlyParamError = function (errorObj, func) {
239234
message = 'It looks like ' + func +
240235
'() received an empty variable in spot #' + errorObj.position +
241236
' (zero-based index). If not intentional, this is often a problem' +
242-
' with scope: [link to scope].';
237+
' with scope: [https://p5js.org/examples/data-variable-scope.html].';
243238
report(message, func, ERR_PARAMS);
244239
break;
245240
case 'WRONG_CLASS':
@@ -259,21 +254,19 @@ p5._friendlyParamError = function (errorObj, func) {
259254
};
260255
function friendlyWelcome() {
261256
// p5.js brand - magenta: #ED225D
262-
var astrixBgColor = 'transparent';
263-
var astrixTxtColor = '#ED225D';
264-
var welcomeBgColor = '#ED225D';
265-
var welcomeTextColor = 'white';
257+
//var astrixBgColor = 'transparent';
258+
//var astrixTxtColor = '#ED225D';
259+
//var welcomeBgColor = '#ED225D';
260+
//var welcomeTextColor = 'white';
266261
console.log(
267-
'%c _ \n'+
262+
' _ \n'+
268263
' /\\| |/\\ \n'+
269264
' \\ ` \' / \n'+
270265
' / , . \\ \n'+
271266
' \\/|_|\\/ '+
272-
'\n\n%c> p5.js says: Welcome! '+
267+
'\n\n> p5.js says: Welcome! '+
273268
'This is your friendly debugger. ' +
274-
'To turn me off switch to using “p5.min.js”.',
275-
'background-color:'+astrixBgColor+';color:' + astrixTxtColor +';',
276-
'background-color:'+welcomeBgColor+';color:' + welcomeTextColor +';'
269+
'To turn me off switch to using “p5.min.js”.'
277270
);
278271
}
279272

@@ -392,12 +385,11 @@ function helpForMisusedAtTopLevelCode(e, log) {
392385
// * Uncaught ReferenceError: PI is not defined (Chrome)
393386

394387
if (e.message && e.message.match('\\W?'+symbol.name+'\\W') !== null) {
395-
log('%cDid you just try to use p5.js\'s ' + symbol.name +
388+
log('Did you just try to use p5.js\'s ' + symbol.name +
396389
(symbol.type === 'function' ? '() ' : ' ') + symbol.type +
397390
'? If so, you may want to ' +
398391
'move it into your sketch\'s setup() function.\n\n' +
399-
'For more details, see: ' + FAQ_URL,
400-
'color: #B40033' /* Dark magenta */);
392+
'For more details, see: ' + FAQ_URL);
401393
return true;
402394
}
403395
});

0 commit comments

Comments
 (0)