print error position if reading config fails
This commit is contained in:
@@ -144,16 +144,26 @@ public:
|
||||
if (result != RESULT_OK) {
|
||||
if (!verbose) {
|
||||
ifs.close();
|
||||
ostringstream error;
|
||||
error << filename <<":" << static_cast<unsigned>(lineNo);
|
||||
m_lastError = error.str();
|
||||
return result;
|
||||
}
|
||||
printErrorPos(row.begin(), end, it, filename, lineNo, result);
|
||||
}
|
||||
} else if (!verbose)
|
||||
m_lastError = "";
|
||||
}
|
||||
|
||||
ifs.close();
|
||||
return RESULT_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a @a string describing the last error position.
|
||||
* @return a @a string describing the last error position.
|
||||
*/
|
||||
virtual string getLastError() { return m_lastError; }
|
||||
|
||||
/**
|
||||
* Add a definition that was read from a file.
|
||||
* @param begin an iterator to the first column of the definition row to read.
|
||||
@@ -171,6 +181,9 @@ private:
|
||||
/** whether this instance supports rows with defaults (starting with a star). */
|
||||
bool m_supportsDefaults;
|
||||
|
||||
/** a @a string describing the last error position. */
|
||||
string m_lastError;
|
||||
|
||||
};
|
||||
|
||||
#endif // LIBEBUS_FILEREADER_H_
|
||||
|
||||
Reference in New Issue
Block a user