Skip to content

Raw console.log calls should use Friendly Error System (FES) #8577

@MASTERsj01

Description

@MASTERsj01

Increasing access

Several source files use raw console.log() for warning/error messages instead of p5._friendlyError(). This means these warnings don't respect p5.disableFriendlyErrors = true.

Affected files

  • src/data/p5.TypedDict.js — 6 instances (in get(), set(), create(), add(), mult(), div())
  • src/data/local_storage.js — 5 instances (in storeItem(), getItem(), removeItem())
  • src/dom/dom.js — 2 instances + 1 leftover debug console.log(id) in removeCue()
  • src/events/mouse.js — 1 instance (in requestPointerLock())
  • src/image/p5.Image.js — 1 instance (in setFrame())

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

Feature enhancement details

Replace 15 raw console.log() calls with p5._friendlyError() across 5 source files so that warning messages respect p5.disableFriendlyErrors = true.

Additionally:

  • Fix typo "dont""don't" in p5.TypedDict.set()
  • Fix missing space in getItem() error message
  • Remove leftover debug console.log(id) in removeCue()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions