* @brief Builds a per-op result entry for a validation failure inside project.batch. */
| 5239 | * @brief Builds a per-op result entry for a validation failure inside project.batch. |
| 5240 | */ |
| 5241 | static QJsonObject buildBatchErrorEntry(int index, |
| 5242 | const QString& command, |
| 5243 | const QString& code, |
| 5244 | const QString& message, |
| 5245 | const QJsonObject& data) |
| 5246 | { |
| 5247 | QJsonObject entry; |
| 5248 | entry[QStringLiteral("index")] = index; |
| 5249 | if (!command.isEmpty()) |
| 5250 | entry[QStringLiteral("command")] = command; |
| 5251 | |
| 5252 | entry[QStringLiteral("success")] = false; |
| 5253 | QJsonObject err; |
| 5254 | err[QStringLiteral("code")] = code; |
| 5255 | err[QStringLiteral("message")] = message; |
| 5256 | if (!data.isEmpty()) |
| 5257 | err[QStringLiteral("data")] = data; |
| 5258 | |
| 5259 | entry[QStringLiteral("error")] = err; |
| 5260 | return entry; |
| 5261 | } |
| 5262 | |
| 5263 | /** |
| 5264 | * @brief Commands that honour `dryRun:true` -- used to validate batch previews. |
no test coverage detected