Skip to content

Commit

Permalink
ErrorCodes::SYNTAX_ERROR now causes HTTP_BAD_REQUEST
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Zatelepin committed Oct 29, 2018
1 parent 6efd0f6 commit 31bc680
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dbms/programs/server/HTTPHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ namespace ErrorCodes
extern const int TOO_BIG_AST;
extern const int UNEXPECTED_AST_STRUCTURE;

extern const int SYNTAX_ERROR;

extern const int UNKNOWN_TABLE;
extern const int UNKNOWN_FUNCTION;
extern const int UNKNOWN_IDENTIFIER;
Expand Down Expand Up @@ -109,6 +111,8 @@ static Poco::Net::HTTPResponse::HTTPStatus exceptionCodeToHTTPStatus(int excepti
exception_code == ErrorCodes::TOO_BIG_AST ||
exception_code == ErrorCodes::UNEXPECTED_AST_STRUCTURE)
return HTTPResponse::HTTP_BAD_REQUEST;
else if (exception_code == ErrorCodes::SYNTAX_ERROR)
return HTTPResponse::HTTP_BAD_REQUEST;
else if (exception_code == ErrorCodes::UNKNOWN_TABLE ||
exception_code == ErrorCodes::UNKNOWN_FUNCTION ||
exception_code == ErrorCodes::UNKNOWN_IDENTIFIER ||
Expand Down

0 comments on commit 31bc680

Please sign in to comment.