Skip to content

Fix confirmout.json handling for missing/malformed files (#16)#96

Open
ba-00001 wants to merge 1 commit into
target:mainfrom
ba-00001:issue-16-confirmout-handling
Open

Fix confirmout.json handling for missing/malformed files (#16)#96
ba-00001 wants to merge 1 commit into
target:mainfrom
ba-00001:issue-16-confirmout-handling

Conversation

@ba-00001

Copy link
Copy Markdown

Relates to #16.

The original 'Could not load PropertiesLauncher' error is already resolved by the Spring Boot 3.5 upgrade (bootJar manifest and devicestarter.sh both use org.springframework.boot.loader.launch.PropertiesLauncher; verified present in the built jar).

This fixes the real remaining bug from the issue thread in DeviceErrorStatusResponse:

  • Logged 'JSON is in wrong format' even when /var/tmp/CONFIRMOUT/confirmout.json was simply missing — now reports a clear 'not found' message.
  • NPE when the file existed but failed to parse (IOException caught but null JsonNode dereferenced) — now returns early.
  • Extracted loading into a testable method; added tests for missing/null/malformed/valid. Full suite passes.

The confirmout.json loader logged "JSON is in wrong format" whenever the
file was simply absent, and would NPE if the file existed but failed to
parse (the IOException was caught but rootDevNode was still dereferenced).

Report a clear "not found" message when the file is missing, return
early after a parse failure instead of dereferencing null, and extract
the loading logic into a testable method. Add unit tests for the
missing, null, malformed, and valid cases.
@ba-00001
ba-00001 requested a review from arpal7 as a code owner July 21, 2026 00:48
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