Skip to content

Conversation

@hellolittlej
Copy link
Collaborator

@hellolittlej hellolittlej commented Jan 23, 2026

Context

  • if the request failed with during unmarshall, we currently only raise the illegal argument ex, but it was not converted into the general error response
  • add a new rejection handler to handle the validation rejection and keep the error response consistent.

Before the change, if the request payload is malformed, it just return plain string as cannot unmarshall Json as...,
After this change, it will return the response as

{
    "time": 1769149134982,
    "host": "MacBook-L6RQY",
    "error": "Cannot construct instance of `io.mantisrx.master.jobcluster.proto.JobClusterManagerProto$V1ResubmitWorkerRequest`, problem: Worker number must be greater than 0\n at [Source: (String)\"{\n  \"user\": \"ggao\",\n  \"workerNumber\": 0,\n  \"reason\": \"test\"\n}\"; line: 5, column: 1]",
    "requestId": -1
}

Checklist

  • ./gradlew build compiles code correctly
  • Added new tests where applicable
  • ./gradlew test passes all tests
  • Extended README or added javadocs where applicable

@github-actions
Copy link

github-actions bot commented Jan 23, 2026

Test Results

664 tests  ±0   652 ✅  - 1   9m 3s ⏱️ +2s
153 suites ±0    11 💤 ±0 
153 files   ±0     1 ❌ +1 

For more details on these failures, see this check.

Results for commit 72b9015. ± Comparison against base commit 759588d.

♻️ This comment has been updated with latest results.

@hellolittlej hellolittlej merged commit 31e164d into master Jan 26, 2026
11 of 15 checks passed
@hellolittlej hellolittlej deleted the fix-error-responsetype branch January 26, 2026 01:27
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.

3 participants