[ https://issues.apache.org/jira/browse/FLINK-7663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16175050#comment-16175050 ]
ASF GitHub Bot commented on FLINK-7663: --------------------------------------- GitHub user tillrohrmann opened a pull request: https://github.com/apache/flink/pull/4699 [FLINK-7663] [flip6] Return BAD_REQUEST if HandlerRequest cannot be created ## What is the purpose of the change This commit changes the behaviour such that a failure in creating a `HandlerRequest` will result in a BAD_REQUEST response by the AbstractRestHandler. ## Brief change log - Introduce the `HandlerRequestException` indicating that the `HandlerRequest` could not be created - Introduce a checked `ConversionException` for `MessageParameter#convertFromString` to let conversions fail explicitly - Send `BAD_REQUEST` response in case that the `HandlerRequest` could not be created ## Verifying this change - Added `RestEndpointITCase#testBadHandlerRequest` ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): (no) - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no) - The serializers: (no) - The runtime per-record code paths (performance sensitive): (no) - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no) ## Documentation - Does this pull request introduce a new feature? (no) - If yes, how is the feature documented? (not applicable) R @zentol You can merge this pull request into a Git repository by running: $ git pull https://github.com/tillrohrmann/flink supportBadRestRequests Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/4699.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #4699 ---- commit 38c8a188ad72a1ce48129077b71df971ade44354 Author: Till Rohrmann <trohrm...@apache.org> Date: 2017-09-21T16:14:45Z [FLINK-7663] [flip6] Return BAD_REQUEST if HandlerRequest cannot be created This commit changes the behaviour such that a failure in creating a HandlerRequest will result in a BAD_REQUEST response by the AbstractRestHandler. ---- > Allow AbstractRestHandler to handle bad requests > ------------------------------------------------ > > Key: FLINK-7663 > URL: https://issues.apache.org/jira/browse/FLINK-7663 > Project: Flink > Issue Type: Bug > Components: REST > Affects Versions: 1.4.0 > Reporter: Till Rohrmann > Assignee: Till Rohrmann > Labels: flip-6 > > The {{AbstractRestHandler}} parses the request and tries to generate a > {{HandlerRequest}}. If this fails, then the server answers with an internal > server error. Instead we should allow the {{AbstractRestHandler}} to be able > to return a BAD_REQUEST status code. In order to do that, I would like to > introduce a {{HandlerRequestException}} which can be thrown while creating > the {{HandlerRequest}}. If this exception is thrown, then we return an error > message with {{BAD_REQUEST}} {{HttpResponseStatus}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)