CalvinKirs commented on issue #11278:
URL: 
https://github.com/apache/dolphinscheduler/issues/11278#issuecomment-1203689006

   > > I think `putMsg` and `Exception` are two different behaviors. We use 
`putMsg` to return valid error messages through API, while exceptions will not 
be returned through API.
   > 
   > I have discuss with @caishunfeng , we think `putMsg` it is redundant and 
we should throw exception directly in serviceImpl, So we add a new 
`ExceptionHandler` in
   > 
   > 
https://github.com/apache/dolphinscheduler/blob/ae6aa53f963d2ea02ab435db1e5548da23e3f882/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/exceptions/ApiExceptionHandler.java#L39-L43
   > 
   > from api side, which will covert the `ServiceException` to `Result` 
object, and return in `controller`. And we already have some existing code in
   > 
https://github.com/apache/dolphinscheduler/blob/ae6aa53f963d2ea02ab435db1e5548da23e3f882/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java#L94-L105
   > 
   > And @SbloodyS do you think it is a good idea about this change? @SbloodyS
   
   +1, make sense to me, `Result` is usually only used as a standard data 
format for external system interaction.


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