From: Dan Mick Date: Fri, 22 Feb 2013 05:41:25 +0000 (-0800) Subject: configuration parsing: give better error for missing = X-Git-Tag: v0.58~17 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8c05af5dc3c398dda4c196a64f344db7ea69d209;p=ceph.git configuration parsing: give better error for missing = A ceph.conf line with "key" and no "= value" currently shows "unexpected character while parsing putative key value, at char N line M". There's no reason it can't be clearer. Fixes: #4229 Signed-off-by: Dan Mick Reviewed-by: Sage Weil --- diff --git a/src/common/ConfUtils.cc b/src/common/ConfUtils.cc index 147cdc2fb60a..5efde8d4ae00 100644 --- a/src/common/ConfUtils.cc +++ b/src/common/ConfUtils.cc @@ -471,8 +471,13 @@ process_line(int line_no, const char *line, std::deque *errors) case ACCEPT_KEY: if ((((c == '#') || (c == ';')) && (!escaping)) || (c == '\0')) { ostringstream oss; - oss << "unexpected character while parsing putative key value, " - << "at char " << (l - line) << ", line " << line_no; + if (c == '\0') { + oss << "end of key=val line " << line_no + << " reached, no \"=val\" found...missing =?"; + } else { + oss << "unexpected character while parsing putative key value, " + << "at char " << (l - line) << ", line " << line_no; + } errors->push_back(oss.str()); return NULL; }