Actions
Feature #628
opencrushtool: better error messages when parsing a crushmap.txt
Status:
New
Priority:
Low
Assignee:
-
Category:
-
Target version:
-
% Done:
0%
Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Component(RADOS):
Pull request ID:
Description
There is a more advanced error handling API for spirit described at:
http://www.boost.org/doc/libs/1_41_0/libs/spirit/classic/doc/error_handling.html
Using this, we could give the user more information about parse errors than just a line number.
Updated by Loïc Dachary over 9 years ago
The crush compiler indeed has minimal error handling
if (!info.full) { int cpos = info.stop - start; //out << "cpos " << cpos << std::endl; //out << " linemap " << line_pos << std::endl; assert(!line_pos.empty()); map<int,int>::iterator p = line_pos.upper_bound(cpos); if (p != line_pos.begin()) --p; int line = p->second; int pos = cpos - p->first; err << infn << ":" << line //<< ":" << (pos+1) << " error: parse error at '" << line_val[line].substr(pos) << "'" << std::endl; return -1; }
Updated by Greg Farnum almost 7 years ago
- Project changed from Ceph to RADOS
- Category deleted (
10)
Actions