Use existing ErrorCode to indicate SELECT failure

This commit is contained in:
comunodi 2019-04-14 20:50:05 +03:00
parent 80827b5a9f
commit 5849d66975

View File

@ -58,7 +58,7 @@ namespace DB
namespace ErrorCodes namespace ErrorCodes
{ {
extern const int UNSUPPORTED_METHOD; extern const int UNSUPPORTED_METHOD;
extern const int SELECT_DB_FAILURE; extern const int CANNOT_SELECT;
} }
@ -85,7 +85,7 @@ namespace DB
std::string reply = client->execute<std::string>(command); std::string reply = client->execute<std::string>(command);
if (reply != "+OK\r\n") if (reply != "+OK\r\n")
throw Exception{"Selecting db with index " + DB::toString(db_index) + " failed with reason " + reply, throw Exception{"Selecting db with index " + DB::toString(db_index) + " failed with reason " + reply,
ErrorCodes::SELECT_DB_FAILURE}; ErrorCodes::CANNOT_SELECT};
} }
} }