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

   ### Version
   
   main branch (2.0.0-SNAPSHOT, eb988d1)
   
   ### Describe what's wrong
   
   `GET /api/metalakes/{metalake}/objects/{type}/{fullName}/secrets` for a type 
that does not support
   secrets (column, tag, and others) returns 500 instead of a 4xx.
   
   - `MetadataObjectSecretOperations.java:108`
     (`server/src/main/java/org/apache/gravitino/server/web/rest/`) throws
     `javax.ws.rs.NotSupportedException("Doesn't support secret property 
operations for metadata object type")`.
   - `SecretExceptionHandler` (`ExceptionHandlers.java:794-819`) maps 
`IllegalArgumentException`,
     Gravitino `NotFoundException` and `NotInUseException`, and passes 
everything else to the base
     handler, which returns 500 (`ExceptionHandlers.java:1255`).
   
   ### Error message and/or stacktrace
   
   ```
   HTTP 500 {"code":1002,"type":"RuntimeException","message":"Failed to operate 
object [probe_tag] operation [GET], reason [Doesn't support secret property 
operations for metadata object type]"}
   ```
   
   ### How to reproduce
   
   1. Create a tag `probe_tag` in a metalake.
   2. `GET /api/metalakes/{metalake}/objects/tag/probe_tag/secrets` returns 500.
      The same happens for a column: 
`.../objects/column/{catalog}.{schema}.{table}.{column}/secrets`.
   
   ### Additional context
   
   Requirement: an unsupported object type returns a 4xx (400 or 405) with the 
existing message.
   Related: #12297 (catalog and schema secrets).


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