You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/10/23 09:19:02 UTC

[GitHub] [incubator-kyuubi] lightning-L opened a new issue, #3681: [Improvement] fix rest api response message

lightning-L opened a new issue, #3681:
URL: https://github.com/apache/incubator-kyuubi/issues/3681

   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   
   
   ### Search before asking
   
   - [X] I have searched in the [issues](https://github.com/apache/incubator-kyuubi/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### What would you like to be improved?
   
   There are many places in rest api that will check the username. When the user does not have access to the target resources, api will throw NotAllowedException.
   <img width="819" alt="image" src="https://user-images.githubusercontent.com/21362040/197377605-f42934ee-69dd-4084-9b77-7e02c14760db.png">
   
   Although we have provided error messages to NotAllowedException, the actual response message is not as expected.
   Add println in test case:
   <img width="716" alt="image" src="https://user-images.githubusercontent.com/21362040/197382982-b0ce6859-50e7-46f3-a7dc-5c76ba569150.png">
   
   Output:
   <img width="751" alt="image" src="https://user-images.githubusercontent.com/21362040/197382991-61d10bb7-e25f-4668-92f1-e29df8f3686f.png">
   
   The reason for the error is very confusing...
   
   However, the behavior for NotFoundException is as expected.
   When batchId is not found, the expected error message is:
   <img width="584" alt="image" src="https://user-images.githubusercontent.com/21362040/197383712-030dcab3-d51a-4e78-9ee3-8acdd7dd40ee.png">
   
   
   Actual output:
   <img width="631" alt="image" src="https://user-images.githubusercontent.com/21362040/197383676-9535507b-fa35-4775-9d6a-65ff18867099.png">
   <img width="543" alt="image" src="https://user-images.githubusercontent.com/21362040/197383684-6890d6cd-78bd-4c4a-a7c7-0c5bd3a26a2d.png">
   
   NotFoundException is constructing the response correctly:
   <img width="786" alt="image" src="https://user-images.githubusercontent.com/21362040/197384172-c91c1ae2-b45c-4329-a5b5-7885dba3d2b5.png">
   
   The constructor method of NotAllowedException is not the same as NotFoundException. It is not taking the string as error message and is not constructing the response as expected.
   <img width="851" alt="image" src="https://user-images.githubusercontent.com/21362040/197384214-fb119288-ba5a-4ac3-87a0-dd4ee13d95b8.png">
   
   
   
   
   ### How should we improve?
   
   Before modification:
   <img width="718" alt="image" src="https://user-images.githubusercontent.com/21362040/197384119-5b98bd2a-2cb4-4427-9542-ee33c85c3e22.png">
   
   
   After code change, the response is as expected.
   <img width="831" alt="image" src="https://user-images.githubusercontent.com/21362040/197384284-03c9dcbf-3820-4553-9831-f179b922d85d.png">
   
   
   
   ### Are you willing to submit PR?
   
   - [ ] Yes. I can submit a PR independently to improve.
   - [X] Yes. I would be willing to submit a PR with guidance from the Kyuubi community to improve.
   - [ ] No. I cannot submit a PR at this time.


-- 
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: notifications-unsubscribe@kyuubi.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei closed issue #3681: [Improvement] fix rest api response message

Posted by GitBox <gi...@apache.org>.
turboFei closed issue #3681: [Improvement] fix rest api response message
URL: https://github.com/apache/incubator-kyuubi/issues/3681


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org