You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/08/03 07:13:12 UTC

[GitHub] [dolphinscheduler] lyleshaw opened a new issue, #11278: [Improvement][API] Change the way exceptions are handled in the API

lyleshaw opened a new issue, #11278:
URL: https://github.com/apache/dolphinscheduler/issues/11278

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
   
   
   ### Description
   
   Now we put the exception into the Result class and parse it.
   This is not an elegant approach, so we would like to change the original
   ```java
   this.putMsg(result, Status.XXX, XXX);
   return result;
   ```
   to
   ```java
   throw new ServiceException(String.format("xxx %s doesn't valid", xxx));
   ```
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] SbloodyS commented on issue #11278: [Improvement][API] Change the way exceptions are handled in the API

Posted by GitBox <gi...@apache.org>.
SbloodyS commented on issue #11278:
URL: https://github.com/apache/dolphinscheduler/issues/11278#issuecomment-1203590961

   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.


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] zhongjiajie commented on issue #11278: [Improvement][API] Change the way exceptions are handled in the API

Posted by GitBox <gi...@apache.org>.
zhongjiajie commented on issue #11278:
URL: https://github.com/apache/dolphinscheduler/issues/11278#issuecomment-1203641275

   > 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 


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] github-actions[bot] commented on issue #11278: [Improvement][API] Change the way exceptions are handled in the API

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #11278:
URL: https://github.com/apache/dolphinscheduler/issues/11278#issuecomment-1235998110

   This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] github-actions[bot] commented on issue #11278: [Improvement][API] Change the way exceptions are handled in the API

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #11278:
URL: https://github.com/apache/dolphinscheduler/issues/11278#issuecomment-1203589741

   Thank you for your feedback, we have received your issue, Please wait patiently for a reply.
   * In order for us to understand your request as soon as possible, please provide detailed information、version or pictures.
   * If you haven't received a reply for a long time, you can [join our slack](https://s.apache.org/dolphinscheduler-slack) and send your question to channel `#troubleshooting`


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] CalvinKirs commented on issue #11278: [Improvement][API] Change the way exceptions are handled in the API

Posted by GitBox <gi...@apache.org>.
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] lyleshaw commented on issue #11278: [Improvement][API] Change the way exceptions are handled in the API

Posted by GitBox <gi...@apache.org>.
lyleshaw commented on issue #11278:
URL: https://github.com/apache/dolphinscheduler/issues/11278#issuecomment-1203596977

   > 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.
   
   @zhongjiajie Hi Jiajie, What's your opinion about this issue?


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] SbloodyS commented on issue #11278: [Improvement][API] Change the way exceptions are handled in the API

Posted by GitBox <gi...@apache.org>.
SbloodyS commented on issue #11278:
URL: https://github.com/apache/dolphinscheduler/issues/11278#issuecomment-1203649209

   That make sense to me. And it's a big project to modify it. I suggest mark it as a `DSIP` and make a todo list just as we do in #10257. WDYT? @zhongjiajie 


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org