justinmclean opened a new issue, #9307:
URL: https://github.com/apache/gravitino/issues/9307

   ### What would you like to be improved?
   
   Change the API to return a 400 response with the illegal-arguments error 
code and message.
   
   Here's a unit test to help:
   ```
     @Test
     public void testAddPartitionWithNullPartitions() {
       AddPartitionsRequest invalidReq = new AddPartitionsRequest();
   
       Response resp =
           target(partitionPath(metalake, catalog, schema, table))
               .request(MediaType.APPLICATION_JSON_TYPE)
               .accept("application/vnd.gravitino.v1+json")
               .post(Entity.entity(invalidReq, 
MediaType.APPLICATION_JSON_TYPE));
   
       Assertions.assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), 
resp.getStatus());
   
       ErrorResponse errorResponse = resp.readEntity(ErrorResponse.class);
       Assertions.assertEquals(ErrorConstants.ILLEGAL_ARGUMENTS_CODE, 
errorResponse.getCode());
       Assertions.assertEquals(IllegalArgumentException.class.getSimpleName(), 
errorResponse.getType());
       Assertions.assertTrue(errorResponse.getMessage().contains("partitions 
must not be null"));
     }
   ```
   
   ### How should we improve?
   
   _No response_


-- 
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]

Reply via email to