Skip to content

#34980 include exception in addBinaries#35045

Merged
dsilvam merged 1 commit intomainfrom
issue-34980-include-exception
Mar 20, 2026
Merged

#34980 include exception in addBinaries#35045
dsilvam merged 1 commit intomainfrom
issue-34980-include-exception

Conversation

@dsilvam
Copy link
Member

@dsilvam dsilvam commented Mar 20, 2026

Summary

  • Pass the caught exception to Logger.warn() in DefaultTransformStrategy#addBinaries so the full stack trace is included in the warning log, not just the message string.

Problem

When a binary field fails to be retrieved during contentlet transformation, the warning log only captured e.getMessage() as a string argument. This meant the stack trace was silently dropped, making it very difficult to diagnose the root cause of binary retrieval failures.

Solution

Pass e as the third argument to Logger.warn(), which triggers the overload that logs both the message and the full exception stack trace.

// Before
Logger.warn(this,
    String.format("An error occurred when retrieving the Binary file from field"
        + " '%s' in Contentlet with ID '%s': %s", field.variable(),
        contentlet.getIdentifier(), e.getMessage()));

// After
Logger.warn(this,
    String.format("An error occurred when retrieving the Binary file from field"
        + " '%s' in Contentlet with ID '%s': %s", field.variable(),
        contentlet.getIdentifier(), e.getMessage()), e);

Test plan

  • Trigger a binary field retrieval failure and confirm the full stack trace appears in the logs

This PR fixes: #34980

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude
Copy link
Contributor

claude bot commented Mar 20, 2026

Claude finished @dsilvam's task in 46s —— View job


Rollback Safety Analysis

  • Reading rollback-unsafe categories reference
  • Getting PR diff
  • Analyzing changes against unsafe categories
  • Applied label: AI: Safe To Rollback

Result: Safe to Rollback ✅

The single-line change adds the exception object e as a third argument to Logger.warn() in DefaultTransformStrategy.java:274, so that the full stack trace is included in the warning log (instead of just e.getMessage()).

This is a pure logging improvement with no impact on:

  • Database schema or data
  • Elasticsearch mappings
  • API contracts
  • OSGi interfaces
  • Storage providers
  • Push publishing bundle format

None of the rollback-unsafe categories (C-1 through M-4) apply.

@dsilvam dsilvam enabled auto-merge March 20, 2026 18:12
@dsilvam dsilvam added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit 39a6c15 Mar 20, 2026
45 checks passed
@dsilvam dsilvam deleted the issue-34980-include-exception branch March 20, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Backend PR changes Java/Maven backend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

bug: DotDataException(Throwable) constructor never sets this.message, masking all wrapped exception messages in logs

3 participants