diff --git a/app/node/project/serializer/serializer.cpp b/app/node/project/serializer/serializer.cpp index f682997be..18a8884e1 100644 --- a/app/node/project/serializer/serializer.cpp +++ b/app/node/project/serializer/serializer.cpp @@ -96,7 +96,10 @@ ProjectSerializer::Result ProjectSerializer::Load(Project *project, return inner_result; } } else { - return kFileError; + Result r(kFileError); + r.SetDetails(QStringLiteral("Unable to open '%1': %2") + .arg(filename, project_file.errorString())); + return r; } } diff --git a/app/render/worker/workermain.cpp b/app/render/worker/workermain.cpp index 978b01a2f..079c08f79 100644 --- a/app/render/worker/workermain.cpp +++ b/app/render/worker/workermain.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -263,6 +264,22 @@ private: bool LoadGraph(const QString &path) { + { + QFileInfo fi(path); + if (!fi.exists()) { + LogError(QStringLiteral("LoadGraph: graph file does not exist: %1").arg(path)); + return Write(ErrorMessage(QStringLiteral("graph file does not exist: %1").arg(path))); + } + if (fi.size() == 0) { + LogError(QStringLiteral("LoadGraph: graph file is empty: %1").arg(path)); + return Write(ErrorMessage(QStringLiteral("graph file is empty: %1").arg(path))); + } + LogError(QStringLiteral("LoadGraph: loading %1 (%2 bytes, readable=%3)") + .arg(path) + .arg(fi.size()) + .arg(fi.isReadable())); + } + auto loaded = std::make_unique(); // Do not call Initialize() here: project serializers expect a blank // project (root_ == nullptr) and will set root themselves. Calling