Project

General

Profile

Feature #628

crushtool: better error messages when parsing a crushmap.txt

Added by Colin McCabe about 12 years ago. Updated over 5 years ago.

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.

History

#1 Updated by Sage Weil over 11 years ago

  • Category set to 10

#2 Updated by Loïc Dachary over 8 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;
  }

#3 Updated by Greg Farnum over 5 years ago

  • Project changed from Ceph to RADOS
  • Category deleted (10)

Also available in: Atom PDF