carloea2 opened a new pull request, #8162: URL: https://github.com/apache/texera/pull/8162
### What changes were proposed in this PR? Return HTTP 400 when dashboard search receives an unknown resource type. The resource dispatch currently throws `IllegalArgumentException`, which Dropwizard reports as HTTP 500. The change uses `BadRequestException` and updates both invalid input cases in the focused spec. Before: unknown resource type returns 500. After: unknown resource type returns 400 with the existing message. Valid resource types are unchanged. ### Any related issues, documentation, discussions? Closes #8161 ### How was this PR tested? Focused tests: `sbt -no-colors "WorkflowExecutionService/testOnly org.apache.texera.web.resource.dashboard.DashboardResourceSpec"` Result: 7 tests passed. Checks: `sbt -no-colors scalafmtCheckAll` `sbt -no-colors "scalafixAll --check"` Localhost verification on the built service: `GET /api/dashboard/publicSearch?resourceType=workflow` returned 200. `GET /api/dashboard/publicSearch?resourceType=not-a-resource` returned 400 with `Unknown resource type: not-a-resource`. The same request returned 500 before the change. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Codex GPT-5 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
