MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / buildBatchErrorEntry

Function buildBatchErrorEntry

app/src/API/Handlers/ProjectHandler.cpp:5241–5261  ·  view source on GitHub ↗

* @brief Builds a per-op result entry for a validation failure inside project.batch. */

Source from the content-addressed store, hash-verified

5239 * @brief Builds a per-op result entry for a validation failure inside project.batch.
5240 */
5241static 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.

Callers 1

executeBatchOpFunction · 0.85

Calls 1

isEmptyMethod · 0.80

Tested by

no test coverage detected