You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mh...@apache.org on 2018/08/10 15:26:28 UTC

asterixdb git commit: [NO ISSUE][FAIL] Return Bad Request on No Statement

Repository: asterixdb
Updated Branches:
  refs/heads/master 107c2059d -> 31d03f078


[NO ISSUE][FAIL] Return Bad Request on No Statement

- user model changes: no
- storage format changes: no
- interface changes: no

Change-Id: I7a1f0cb61f792d9a40efb0c23ac8679df659f474
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2873
Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mb...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/31d03f07
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/31d03f07
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/31d03f07

Branch: refs/heads/master
Commit: 31d03f078fb5afe6bfb52e2c2788a89d7f333579
Parents: 107c205
Author: Murtadha Hubail <mh...@apache.org>
Authored: Fri Aug 10 07:33:24 2018 -0700
Committer: Murtadha Hubail <mh...@apache.org>
Committed: Fri Aug 10 08:26:03 2018 -0700

----------------------------------------------------------------------
 .../org/apache/asterix/api/http/server/QueryServiceServlet.java  | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/31d03f07/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java
index c05ce6f..a32f8be 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java
@@ -19,6 +19,7 @@
 package org.apache.asterix.api.http.server;
 
 import static org.apache.asterix.common.exceptions.ErrorCode.ASTERIX;
+import static org.apache.asterix.common.exceptions.ErrorCode.NO_STATEMENT_PROVIDED;
 import static org.apache.asterix.common.exceptions.ErrorCode.REJECT_BAD_CLUSTER_STATE;
 import static org.apache.asterix.common.exceptions.ErrorCode.REJECT_NODE_UNREGISTERED;
 import static org.apache.asterix.common.exceptions.ErrorCode.REQUEST_TIMEOUT;
@@ -626,6 +627,9 @@ public class QueryServiceServlet extends AbstractQueryApiServlet {
                     LOGGER.warn("handleException: {}: {}", he.getMessage(), param);
                     state.setStatus(ResultStatus.FATAL, HttpResponseStatus.SERVICE_UNAVAILABLE);
                     break;
+                case ASTERIX + NO_STATEMENT_PROVIDED:
+                    state.setStatus(ResultStatus.FATAL, HttpResponseStatus.BAD_REQUEST);
+                    break;
                 default:
                     LOGGER.warn("handleException: unexpected exception {}: {}", he.getMessage(), param, he);
                     state.setStatus(ResultStatus.FATAL, HttpResponseStatus.INTERNAL_SERVER_ERROR);