Skip to content

Commit c92d60f

Browse files
azchohfiCopilot
andcommitted
Log the actual pricing failure rather than a blanket PriceId message
Addresses Copilot review feedback on #175. TryPreservePricing logged "The submission has PriceId '{PriceId}'" for all three failure modes, so the missing-pricing case reported a null PriceId as though an invalid one were the problem. Each branch now logs what actually happened, which matches what the console already told the user. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 06440e13-c898-4e58-8764-d7abf304d9d8
1 parent 5a782be commit c92d60f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

MSStore.CLI/Helpers/IStorePackagedAPIExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,20 +833,22 @@ internal static bool TryPreservePricing(IAnsiConsole ansiConsole, DevCenterSubmi
833833
// differently: the first two are rejected outright, an empty price id is accepted and
834834
// silently turns the product free. Stop for all three, and say which one it is.
835835
var priceId = submission.Pricing?.PriceId;
836-
logger.LogError("Cannot preserve the product's price. The submission has PriceId '{PriceId}', which cannot be sent back.", priceId);
837836

838837
ansiConsole.MarkupLine("[red bold]Could not preserve this product's price.[/]");
839838

840839
if (submission.Pricing == null)
841840
{
841+
logger.LogError("Cannot preserve the product's price: the submission carries no pricing, which the API rejects on update.");
842842
ansiConsole.MarkupLine("The Store returned no pricing for this product, and the submission API rejects an update that does not carry one.");
843843
}
844844
else if (string.IsNullOrWhiteSpace(priceId))
845845
{
846+
logger.LogError("Cannot preserve the product's price: the submission has no PriceId, and sending that resets the product to free.");
846847
ansiConsole.MarkupLine("The Store returned no base price for this product. The submission API would accept that and silently reset the product to [bold]Free[/].");
847848
}
848849
else
849850
{
851+
logger.LogError("Cannot preserve the product's price: the submission has PriceId '{PriceId}', which the API rejects on update.", priceId);
850852
ansiConsole.MarkupLine($"The Store returned a base price of [yellow]'{priceId.EscapeMarkup()}'[/], which the submission API rejects on update. This happens when the price is managed per market from Partner Center.");
851853
}
852854

0 commit comments

Comments
 (0)