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

+12
View File
@@ -1,5 +1,6 @@
using System.IO;
using System.Net.Http;
using Titano.App.Shell;
using Titano.Core.Archiving;
using Titano.Core.Import;
using Titano.Core.Localization;
@@ -29,6 +30,17 @@ public static class ImportFailures
_ => Loc.L("Import.Failed.Other"),
};
/// <summary>
/// Why the photos an import into a folder or the server never reached were not copied (<see cref="LocalImport"/>):
/// the card left, the destination is full or refuses writing, or the server answered with its own sentence, does
/// not answer (a timeout too) or is no longer trusted.
/// </summary>
public static string Stop(Exception ex, string source) => ex switch
{
TitanoApiException or HttpRequestException or UntrustedCertificateException or OperationCanceledException => ErrorText.ForServer(ex),
_ => Import(ex, source),
};
/// <summary>Why the card or folder could not be planned.</summary>
public static string Plan(Exception ex, string source) => ex switch
{