Problem/Motivation

A provider failure logs the provider's error message. That message can include part of the API key: OpenAI echoes a wrong key, and a masked form of a real one.

Steps to reproduce

  1. Set a wrong API key on the provider.
  2. Generate an image.
  3. Read the ai_media entry in Recent log messages.

Proposed resolution

Log a fixed text with the operation and the exception class, without the provider message.

Before (1.0.x): the ai_media entry in Recent log messages carries the provider's text, with the key (a fake test key here).

 sk-wrong.

After: the entry names the operation and the exception class only.

 the log message reads image generation failed with OpenAI\Exceptions\ErrorException.

Remaining tasks

  • ✅ File an issue
  • ❌ Addition/Change/Update/Fix
  • ❌ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support
  • ➖ User Guide Documentation support
  • ➖ UX/UI designer responsibilities
  • ➖ Accessibility and Readability
  • ❌ Reviewed by a human
  • ❌ Code review by maintainers
  • ❌ Full testing and approval
  • ❌ Credit contributors
  • ❌ Review with the product owner
  • ✅ Update Release Notes
  • ✅ Release

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • N/A

AI-Generated: Yes

Issue fork ai_media-3634860

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajab natshah created an issue. See original summary.

  • rajab natshah committed 6436e255 on 1.0.x
    fix: #3634860 Log a fixed text and the exception class instead of the...
rajab natshah’s picture

Issue summary: View changes
StatusFileSize
new82.04 KB
new76.68 KB
rajab natshah’s picture

Issue summary: View changes
Status: Active » Fixed
Issue tags: +ai_media-1.0.0-rc1

✅ Released ai_media-1.0.0-rc1

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.