From 7cfd26b4eb3280185796203a7f96d675d7c79b33 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Thu, 31 Jul 2014 14:34:49 -0400 Subject: [PATCH] better json parsing diagnostics --- openbr/plugins/gallery.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openbr/plugins/gallery.cpp b/openbr/plugins/gallery.cpp index 7711589..620b11a 100644 --- a/openbr/plugins/gallery.cpp +++ b/openbr/plugins/gallery.cpp @@ -350,9 +350,12 @@ class jsonGallery : public BinaryGallery Template readTemplate() { QJsonParseError error; - File file = QJsonDocument::fromJson(gallery.readLine(), &error).object().toVariantMap(); - if (error.error != QJsonParseError::NoError) + const QByteArray line = gallery.readLine(); + File file = QJsonDocument::fromJson(line, &error).object().toVariantMap(); + if (error.error != QJsonParseError::NoError) { + qWarning("Couldn't parse: %s\n", line.data()); qFatal("%s\n", qPrintable(error.errorString())); + } return file; } -- libgit2 0.21.4