zentol opened a new pull request #11237: [FLINK-13934][rest] Throw 
RestHandlerException instead of sending inline response
URL: https://github.com/apache/flink/pull/11237
 
 
   The `StaticFileServerHandlers` so far used a different approach to 
error-handling as other REST handlers, as they were sending response directly 
(and returning afterwards), instead of throwing a `RestHandlerException` that 
is processed higher up the stack.
   This apprahc is both more noisy and increases the risk of introducing bugs 
during refactorings, since you cannot just take a block of error handling code 
and move it into a separate method, since you're then missing the return.
   
   This exact problem has occurred when I introduced the `checkFileValidity()` 
method. Currently the handlers continue processing even if one check failed, 
leading to inconsistent responses.
   
   This PR adjusts the error handling in these handlers accordingly, and adjust 
the `HistoryServerStaticFileServerHandlerTest` to check for the correct error 
messages, and strenghtens the assertions by also verifying the response codes.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to