xiaochen-zhou commented on code in PR #10696:
URL: https://github.com/apache/seatunnel/pull/10696#discussion_r3028330018


##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/filter/ExceptionHandlingFilter.java:
##########
@@ -64,7 +65,7 @@ private void handleException(int status, HttpServletResponse 
response, Exception
         response.setContentType("application/json;charset=UTF-8");
 
         ErrResponse errorResponse = new ErrResponse();
-        errorResponse.setMessage(e.getMessage());
+        errorResponse.setMessage(ExceptionUtils.getStackTrace(e));

Review Comment:
   > I’m not sure we should return the full stack trace in the REST response. 
Since `log.error(..., e)` already records the full exception in the server 
logs, would it be better to keep only `e.getMessage()` here?
   
   The specific error information should be returned to the submission client. 
For example:
   ```
   org.apache.seatunnel.api.configuration.util.OptionValidationException: 
ErrorCode:[API-02], ErrorDescription:[Option item validate failed] - There are 
unconfigured options, these options ('tables_configs', 'path') are mutually 
exclusive, allowing only one set ("[] for a set") of options to be configured.
   
   at 
org.apache.seatunnel.api.configuration.util.ConfigValidator.validate(ConfigValidator.java:178)
   at 
org.apache.seatunnel.api.configuration.util.ConfigValidator.validate(ConfigValidator.java:103)
   at 
org.apache.seatunnel.api.configuration.util.ConfigValidator.validate(ConfigValidator.java:47)
   at 
org.apache.seatunnel.api.table.factory.FactoryUtil.createAndPrepareSource(FactoryUtil.java:178)
   at 
org.apache.seatunnel.api.table.factory.FactoryUtil.restoreAndPrepareSource(FactoryUtil.java:136)
   ... 43 more
   ```
   This will help the user identify and resolve the issue more effectively.



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