Skip to content
Draft
Changes from 1 commit
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
Prev Previous commit
Next Next commit
linting 😅
  • Loading branch information
outofambit committed Apr 4, 2023
commit 90e9cb13fb2894c6d9511e697d3b969229e3b3f2
18 changes: 9 additions & 9 deletions src/core/friendly_errors/fes_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ if (typeof IS_MINIFIED !== 'undefined') {
p5._report(message, func, color);
};

/**
/**
* This can be called from anywhere in the p5 library to show users
* a localized error message. Instead of passing the message itself, we
* pass a "key" that refers to a message contained in our bank of
* translations for all our supported languages (including English). (See
* `/translations/en/translation.json`).
*
*
* This works well for simple messages. If you want to do something more complex
* (like include a filename from an error), you'll need to use translator() and
* p5._friendlyError() together.
Expand All @@ -218,13 +218,13 @@ if (typeof IS_MINIFIED !== 'undefined') {
* @param {String} [func] Name of the function linked to error
* @param {Number|String} [color] CSS color code
*/
p5._friendlyLocalizedError = function(messageKey, func, color) {
// in the future we could support more direct calls to translator()
// to support extra arguments for complex messages
// by adding a typeof if statement on messageKey
const message = translator(messageKey);
p5._report(message, func, color);
};
p5._friendlyLocalizedError = function(messageKey, func, color) {
// in the future we could support more direct calls to translator()
// to support extra arguments for complex messages
// by adding a typeof if statement on messageKey
const message = translator(messageKey);
p5._report(message, func, color);
};

/**
* This is called internally if there is an error with autoplay. Generates
Expand Down