Skip to content

Fix exception logging to always include stack traces #127

Description

@jordanpadams

Summary

Several error-handling sites in harvest and common log only the exception message string, silently dropping the full stack trace. This makes it impossible to diagnose the root cause of failures from logs alone.

Affected Files

  • harvest/src/main/java/gov/nasa/pds/harvest/crawler/FilesProcessor.java lines 153, 172 — log.error(ex.getMessage())
  • harvest/src/main/java/gov/nasa/pds/harvest/crawler/ProductProcessor.java lines 146, 168 — log.warn/error(ex.getMessage())
  • common/src/main/java/gov/nasa/pds/registry/common/connection/aws/RestClientWrapper.java line 77 — log.error("OSE message: {} <status code = {}>", ose.getMessage(), ose.status())

Acceptance Criteria

  • All exception log calls pass the exception object as the final argument so the full stack trace is preserved:
    • log.error("message", ex) not log.error(ex.getMessage())
  • Stack traces appear at the same level as the message (not demoted to DEBUG) unless the issue is genuinely expected/non-fatal, in which case the rationale should be commented
  • No regression: existing correct sites (e.g., HarvestCli.java, SchemaUpdater.java) remain unchanged

For Internal Dev Team To Complete

⚙️ Engineering Details

🎉 Integration & Test

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

Type

Projects

Status
ToDo
Status
Review/QA

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions