Skip to content

fix: exit cleanly on failed login in oiecommand#265

Open
dowel015 wants to merge 1 commit intoOpenIntegrationEngine:mainfrom
dowel015:fix/oiecommand-hangs-on-failed-login-224
Open

fix: exit cleanly on failed login in oiecommand#265
dowel015 wants to merge 1 commit intoOpenIntegrationEngine:mainfrom
dowel015:fix/oiecommand-hangs-on-failed-login-224

Conversation

@dowel015
Copy link

Summary

  • oiecommand hung indefinitely after a failed login because UnauthorizedException was caught by the generic ClientException handler, which only printed a stack trace and returned — leaving Jersey HTTP client threads alive and the JVM running
  • Added a specific UnauthorizedException catch before the generic ClientException catch that prints a clear "invalid username or password" message and calls System.exit(1)
  • Also changed the generic ClientException handler to exit rather than silently return, preventing the same hang for other connection errors

Fixes #224

Test plan

  • Run oiecommand -a https://localhost:8443 -u admin -p wrongpassword — confirm it prints a clean error and exits immediately with code 1
  • Run with correct credentials — confirm normal login and operation still works

🤖 Generated with Claude Code

…e#224)

UnauthorizedException was caught by the generic ClientException handler
which only printed a stack trace and returned, leaving Jersey HTTP client
threads running and the process hanging indefinitely.

Catch UnauthorizedException before ClientException, print a clear
"invalid username or password" message, and call System.exit(1) so the
process terminates. Also exit on other ClientExceptions rather than
swallowing them silently.

Fixes OpenIntegrationEngine#224

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dowel015 dowel015 force-pushed the fix/oiecommand-hangs-on-failed-login-224 branch from 60fee51 to 7e5b7e5 Compare March 13, 2026 15:52
@mgaffigan
Copy link
Contributor

@dowel015, Thanks for the PR! It looks good to me, but you need to sign your commit to comply with the MPL license of the project. See https://www.secondstate.io/articles/dco/ or the failing check for details.

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.

oiecommand hangs after failed login attempt

2 participants