Skip to content

p5.Texture: replace console.log/warn with Friendly Error System (FES) #8585

@MASTERsj01

Description

@MASTERsj01

Increasing access

Using p5._friendlyError() instead of raw console.log/warn ensures that device capability and texture wrap mode warnings are displayed consistently through the Friendly Error System. This helps beginners understand issues more clearly and allows advanced users to suppress these messages via p5.disableFriendlyErrors.

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

src/webgl/p5.Texture.js uses 4 console.log and 4 console.warn calls instead of p5._friendlyError():

  • Lines 64, 72, 77, 85: console.log for device capability fallback messages (HALF_FLOAT, FLOAT, linear filtering)
  • Lines 400, 412, 429, 441: console.warn for texture wrap mode warnings (REPEAT/MIRROR on non-power-of-two textures)

These should use p5._friendlyError() for consistency with the rest of the codebase.

I have a PR ready for this.

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