mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
fix: log error if file open/commit fails
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
09823dbb4a
commit
838687fb2e
23 changed files with 54 additions and 44 deletions
|
|
@ -49,7 +49,7 @@ class LibraryTest : public QObject {
|
|||
{
|
||||
QFile jsonFile(path);
|
||||
if (!jsonFile.open(QIODevice::ReadOnly)) {
|
||||
qCritical() << "Failed to open file" << jsonFile.fileName() << "for reading!";
|
||||
qCritical() << "Failed to open file" << jsonFile.fileName() << "for reading:" << jsonFile.errorString();
|
||||
return LibraryPtr();
|
||||
}
|
||||
auto data = jsonFile.readAll();
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class MojangVersionFormatTest : public QObject {
|
|||
{
|
||||
QFile jsonFile(path);
|
||||
if (!jsonFile.open(QIODevice::ReadOnly)) {
|
||||
qWarning() << "Failed to open file '" << jsonFile.fileName() << "' for reading!";
|
||||
qWarning() << "Failed to open file" << jsonFile.fileName() << "for reading:" << jsonFile.errorString();
|
||||
return QJsonDocument();
|
||||
}
|
||||
auto data = jsonFile.readAll();
|
||||
|
|
@ -21,7 +21,7 @@ class MojangVersionFormatTest : public QObject {
|
|||
{
|
||||
QFile jsonFile(file);
|
||||
if (!jsonFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
qCritical() << "Failed to open file '" << jsonFile.fileName() << "' for writing!";
|
||||
qCritical() << "Failed to open file" << jsonFile.fileName() << "for writing:" << jsonFile.errorString();
|
||||
return;
|
||||
}
|
||||
auto data = doc.toJson(QJsonDocument::Indented);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class VersionTest : public QObject {
|
|||
QFile vector_file{ test_vector_dir.absoluteFilePath("test_vectors.txt") };
|
||||
|
||||
if (!vector_file.open(QFile::OpenModeFlag::ReadOnly)) {
|
||||
qCritical() << "Failed to open file '" << vector_file.fileName() << "' for reading!";
|
||||
qCritical() << "Failed to open file" << vector_file.fileName() << "for reading:" << vector_file.errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue