mirror of https://github.com/rusefi/rusefi.git
better error handling
This commit is contained in:
parent
f635029c6a
commit
c422337b55
|
@ -30,6 +30,9 @@ void CsvReader::open(const char *fileName, const int* triggerColumnIndeces, cons
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CsvReader::haveMore() {
|
bool CsvReader::haveMore() {
|
||||||
|
if (fp == nullptr) {
|
||||||
|
throw std::runtime_error("No file");
|
||||||
|
}
|
||||||
bool result = fgets(buffer, sizeof(buffer), fp) != nullptr;
|
bool result = fgets(buffer, sizeof(buffer), fp) != nullptr;
|
||||||
m_lineIndex++;
|
m_lineIndex++;
|
||||||
if (m_lineIndex == 0) {
|
if (m_lineIndex == 0) {
|
||||||
|
|
Loading…
Reference in New Issue