fix(import): say why a photo was not copied with a catalog sentence

A photo the executor could not copy now carries one localized sentence
(ImportExecutor.FailureText: its own checks, a full destination, access
denied, else "The photo could not be read or copied.") on the Import
screen and in the import job's log. The photos a stopped folder or
server import never reached show the stop's cause (ImportFailures.Stop:
the server's own sentence, not answering, untrusted certificate, card
gone, destination full or not writable), and a failed index check reads
"The index could not be read or written.". A refusal without words
reads as the catalog's sentence. The system's text stays in the log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-12 15:53:49 +00:00
1 parent 32a0e9bbc1
commit 5cf918ed66
11 files changed
+132 -17

No files matched your search

+3 -3
View File
@@ -211,7 +211,8 @@ public sealed record ImportOutcome(int Copied, int Duplicates, int Skipped, IRea
/// </summary>
public static class LocalImport
{
public static async Task<ImportOutcome> RunAsync(ImportPlan plan, IImportSink sink, bool verify, IProgress<ImportProgress>? progress,
/// <param name="source">The card or folder as the Devices list names it (a card that leaves is named in each failure).</param>
public static async Task<ImportOutcome> RunAsync(ImportPlan plan, IImportSink sink, string source, bool verify, IProgress<ImportProgress>? progress,
CancellationToken cancellationToken, ImportSinkReport? report = null)
{
var results = new List<ImportItemResult>(plan.FileCount);
@@ -232,8 +233,7 @@ public static class LocalImport
catch (Exception ex) when (!cancellationToken.IsCancellationRequested && Stops(ex))
{
Log.Warning("import", $"Import into {plan.DestinationRoot} stopped", ex);
// The server's own sentence (in the user's language) rather than the status line.
stopped = ex is TitanoApiException api ? api.Error.Message : ex.Message;
stopped = ImportFailures.Stop(ex, source);
}
return ImportOutcome.From(plan, results, verify, report, stopped);
}