Log xml parse errors when loading card database (#6006)

This commit is contained in:
RickyRister 2025-06-25 06:20:29 -07:00 committed by GitHub
parent 208f8349a6
commit 4f1b4b1283
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 2 deletions

View file

@ -245,8 +245,9 @@ LoadStatus CardDatabase::loadCardDatabase(const QString &path)
}
int msecs = startTime.msecsTo(QTime::currentTime());
qCInfo(CardDatabaseLoadingLog) << "Path =" << path << "Status =" << tempLoadStatus << "Cards =" << cards.size()
<< "Sets =" << sets.size() << QString("%1ms").arg(msecs);
qCInfo(CardDatabaseLoadingLog) << "Loaded card database: Path =" << path << "Status =" << tempLoadStatus
<< "Cards =" << cards.size() << "Sets =" << sets.size()
<< QString("%1ms").arg(msecs);
return tempLoadStatus;
}

View file

@ -64,6 +64,11 @@ void CockatriceXml3Parser::parseFile(QIODevice &device)
}
}
}
if (xml.hasError()) {
QString preamble = tr("Parse error at line %1 col %2:").arg(xml.lineNumber()).arg(xml.columnNumber());
qCWarning(CockatriceXml3Log).noquote() << preamble << xml.errorString();
}
}
void CockatriceXml3Parser::loadSetsFromXml(QXmlStreamReader &xml)

View file

@ -66,6 +66,11 @@ void CockatriceXml4Parser::parseFile(QIODevice &device)
}
}
}
if (xml.hasError()) {
QString preamble = tr("Parse error at line %1 col %2:").arg(xml.lineNumber()).arg(xml.columnNumber());
qCWarning(CockatriceXml4Log).noquote() << preamble << xml.errorString();
}
}
void CockatriceXml4Parser::loadSetsFromXml(QXmlStreamReader &xml)