Maybe we can send a
   

405 Method Not Allowed


message. 


------------------ ???????? ------------------
??????: "yhs0092"<yhs0...@163.com>;
????????: 2018??11??1??(??????) ????8:56
??????: "dev@servicecomb.apache.org"<dev@servicecomb.apache.org>;

????: Re:  [Discuss][JavaChassis] about customization of 
vertxorg.apache.servicecomb.transport.rest.vertx.RestBodyHandler



Hi, I've tried to remove ServiceComb exceptions from RestBodyHandler today. 
Technically, it is feasible.
In my test, I replace the ServiceComb exceptions with IllegalArgumentException 
in the case that upload directory is not specified and replace with 413 status 
code in the case that uploaded file is too large. In GlobalRestFailureHandler I 
recognize the exception and status code and then return corresponding response.


This solution seems working well, but there are still some details need to be 
discussed. The first one is whether it's proper to use IllegalArgumentException 
in this situation. I use it because I cannot find other Exception more 
accurately express the meaning "upload directory is not specified". The other 
one is that the logic to convert the exceptions into error response is set in 
GlobalRestFailureHandler. It seems not elegant, but I still don't find any 
better solution.


Yours sincerely


Yao Haishi
yhs0...@163.com


On 10/31/2018 17:54??yhs0092<yhs0...@163.com> wrote??
Hi, one of the JavaChassis exception wrapped in RestBodyHandler is added by me.
I will try to remove the JavaChassis exceptions in RestBodyHandler and see 
whether it can works well.


Yours sincerely


Yao Haishi
yhs0...@163.com


On 10/31/2018 09:00??wjm wjm<zzz...@gmail.com> wrote??
currently we
customized org.apache.servicecomb.transport.rest.vertx.RestBodyHandler
1.disable upload feature when uploadDir is null, this is a general
requirement
2.wrap some exceptions to JavaChassis exception?? this is not a general
requirement

if there is only customization 1, maybe we can try to raise a PR to vertx
otherwise we always forget to merge latest vertx logic to our code.

maybe we can confirm if customization 2 is necessary.

Reply via email to