diff options
| author | Mitch Curtis <mitch.curtis@qt.io> | 2025-07-31 10:48:42 +0800 |
|---|---|---|
| committer | Mitch Curtis <mitch.curtis@qt.io> | 2025-08-01 10:18:52 +0800 |
| commit | 4edbd011d62619540162425fefbf58fb8d82c0b0 (patch) | |
| tree | 24d17d651e62eb6cafd8ba1a82ae6452988d5808 /src | |
| parent | ea881d22107f16aab80ed4ec77312bd1cf814150 (diff) | |
androiddeployqt: improve "Invalid json file" error message
Before:
Invalid json file: [...]/android-appuntitled15-deployment-settings.json
After:
Invalid json file: [...]/android-appuntitled15-deployment-settings.json. Reason: illegal value at offset 2957.
Pick-to: 6.5 6.8 6.9 6.10
Change-Id: Ia7fd781036bdad795f4509e49e543b03d2be0f27
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/androiddeployqt/main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 93f792d80fc..0c6ceb43349 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -1023,9 +1023,13 @@ bool readInputFile(Options *options) } dependenciesForDepfile << options->inputFileName; - QJsonDocument jsonDocument = QJsonDocument::fromJson(file.readAll()); + QJsonParseError jsonParseError; + QJsonDocument jsonDocument = QJsonDocument::fromJson(file.readAll(), &jsonParseError); if (jsonDocument.isNull()) { - fprintf(stderr, "Invalid json file: %s\n", qPrintable(options->inputFileName)); + fprintf(stderr, "Invalid json file: %s. Reason: %s at offset %i.\n", + qPrintable(options->inputFileName), + qPrintable(jsonParseError.errorString()), + jsonParseError.offset); return false; } |
