Project

General

Profile

Actions

Feature #628

open

crushtool: better error messages when parsing a crushmap.txt

Added by Colin McCabe over 13 years ago. Updated almost 7 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.

Actions #1

Updated by Sage Weil over 12 years ago

  • Category set to 10
Actions #2

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;
  }

Actions #3

Updated by Greg Farnum almost 7 years ago

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

Also available in: Atom PDF