Skip to content

Propagate error in FileUtil.getFileCreationTime#55

Open
micheleh wants to merge 1 commit intomasterfrom
fix/propagate-error-file-creation-time
Open

Propagate error in FileUtil.getFileCreationTime#55
micheleh wants to merge 1 commit intomasterfrom
fix/propagate-error-file-creation-time

Conversation

@micheleh
Copy link
Copy Markdown
Collaborator

@micheleh micheleh commented Apr 5, 2026

Summary

  • FileUtil.getFileCreationTime() now throws RuntimeException instead of silently returning "" when the file cannot be read

Context

Since the initial commit (c71ed1f, 2021-11-15), this method caught IOException and returned an empty string with the comment //TODO:error just return empty, log error. That TODO was never addressed in 4.5 years.

The empty string flows through OctaneFeature.setStarted("") into the output XML as started="", where ALM Octane expects a millisecond timestamp. The user gets silently wrong output with no warning. Notably, the same class already throws RuntimeException in getResultFilePath() on failure — this fix makes error handling consistent.

Verification

  • Non-existent and missing files now throw RuntimeException with a descriptive message
  • Full test suite passes (42 tests, 0 failures)

Replace silent empty string return with RuntimeException when
file creation time cannot be read. The empty string caused
started="" in the output XML, silently producing wrong data
that ALM Octane could not interpret as a timestamp.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@micheleh micheleh requested a review from nissimshitrit April 5, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant