From 7d06c32b0d5613c169e5c8cdeaa37f53fcfcecf0 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Fri, 24 Jun 2016 13:48:57 -0300 Subject: [PATCH] Adds error messages while failed to init a collection --- src/actions/init_col.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/actions/init_col.cc b/src/actions/init_col.cc index 69d19efc..a3a0b269 100644 --- a/src/actions/init_col.cc +++ b/src/actions/init_col.cc @@ -32,9 +32,11 @@ bool InitCol::init(std::string *error) { int posEquals = m_parser_payload.find("="); if (m_parser_payload.size() < 8) { + error->assign("Something wrong with initcol format: too small"); return false; } if (posEquals == std::string::npos) { + error->assign("Something wrong with initcol format: missing equals sign"); return false; } @@ -42,6 +44,7 @@ bool InitCol::init(std::string *error) { m_collection_value = std::string(m_parser_payload, posEquals + 1); if (m_collection_key != "ip" && m_collection_key != "global") { + error->assign("Something wrong with initcol: collection must be `ip' or `global'"); return false; }