SARAMALI15792 commented on PR #10635:
URL: https://github.com/apache/gravitino/pull/10635#issuecomment-4215153669
Fixed the failing `testInvalidMetadataObjectType` test.
**Changes:**
- Added `IllegalArgumentException` catch block in
`GravitinoInterceptionService.java` (line 209)
- The catch block re-throws the exception to allow it to propagate to REST
endpoint handlers
- This ensures invalid metadata object types return HTTP 400 instead of HTTP
500
**Implementation:**
The fix adds a specific catch block before the generic `Exception` handler:
```java
} catch (IllegalArgumentException ex) {
// Let IllegalArgumentException propagate to REST endpoint handlers
// This allows proper HTTP 400 error responses for invalid input
throw ex;
}
```
**Testing:**
CI will verify that:
- `testInvalidMetadataObjectType` now passes
- No regressions in other tests
- Invalid metadata types return HTTP 400 with descriptive error messages
Commit: 1583a0c622633be42bd98310804620852bd73651
--
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]