diff --git a/src/data/p5.TypedDict.js b/src/data/p5.TypedDict.js index 449887157b..5dbbda30a4 100644 --- a/src/data/p5.TypedDict.js +++ b/src/data/p5.TypedDict.js @@ -164,7 +164,7 @@ p5.TypedDict = class TypedDict { if (this.data.hasOwnProperty(key)) { return this.data[key]; } else { - console.log(`${key} does not exist in this Dictionary`); + p5._friendlyError(`${key} does not exist in this Dictionary`); } } @@ -191,7 +191,7 @@ p5.TypedDict = class TypedDict { if (this._validate(value)) { this.data[key] = value; } else { - console.log('Those values dont work for this dictionary type.'); + p5._friendlyError('Those values dont work for this dictionary type.'); } } @@ -235,7 +235,7 @@ p5.TypedDict = class TypedDict { } else if (typeof key !== 'undefined') { this.set(key, value); } else { - console.log( + p5._friendlyError( 'In order to create a new Dictionary entry you must pass ' + 'an object or a key, value pair' ); @@ -459,7 +459,7 @@ p5.NumberDict = class NumberDict extends p5.TypedDict { if (this.data.hasOwnProperty(key)) { this.data[key] += amount; } else { - console.log(`The key - ${key} does not exist in this dictionary.`); + p5._friendlyError(`The key - ${key} does not exist in this dictionary.`); } } @@ -509,7 +509,7 @@ p5.NumberDict = class NumberDict extends p5.TypedDict { if (this.data.hasOwnProperty(key)) { this.data[key] *= amount; } else { - console.log(`The key - ${key} does not exist in this dictionary.`); + p5._friendlyError(`The key - ${key} does not exist in this dictionary.`); } } @@ -536,7 +536,7 @@ p5.NumberDict = class NumberDict extends p5.TypedDict { if (this.data.hasOwnProperty(key)) { this.data[key] /= amount; } else { - console.log(`The key - ${key} does not exist in this dictionary.`); + p5._friendlyError(`The key - ${key} does not exist in this dictionary.`); } }