Add warning log for invalid data in command cache retrieval

This commit is contained in:
Mario Campos
2026-06-19 18:04:52 -05:00
parent 649bababe7
commit b3c7aa7372
2 changed files with 2 additions and 0 deletions

1
lib/entry-points.js generated
View File

@@ -149955,6 +149955,7 @@ function getCachedCommandOutput(key, cmd, validate) {
}
const entry = readCommandCacheFile()[key];
if (!isObject(entry) || !isString(entry.cmd) || cmd !== void 0 && entry.cmd !== cmd || validate !== void 0 && !validate(entry.output)) {
logger.warning("Received invalid data from the command-cache file.");
return void 0;
}
cacheCommandOutput(key, entry.cmd, entry.output);

View File

@@ -121,6 +121,7 @@ export function getCachedCommandOutput<T>(
(cmd !== undefined && entry.cmd !== cmd) ||
(validate !== undefined && !validate(entry.output))
) {
logger.warning("Received invalid data from the command-cache file.");
return undefined;
}