fix(app): say why an action failed in localized words, not exception text
Error toasts showed the exception's own message, often technical English from .NET or the OS, under a translated title. The editor's failed save, a job posted to the server from the Library, and the card check or delete after an import now say why in one catalog sentence: what the server answered or that it does not answer, that the card left, is locked or a file could not be read, and the archive causes of ArchiveFailures for a local save. The details stay 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:
10 files changed
+163
-5
No files matched your search
@@ -2,6 +2,7 @@ using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
using Titano.App.Archiving;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Jobs;
|
||||
using Titano.App.Server;
|
||||
@@ -829,11 +830,14 @@ public sealed class EditorViewModel : LocalizedViewModel, IAsyncDisposable
|
||||
base.OnLanguageChanged();
|
||||
}
|
||||
|
||||
/// <summary>The first failure of a run of failed saves (they are retried until one succeeds); Retry tries at once.</summary>
|
||||
/// <summary>
|
||||
/// The first failure of a run of failed saves (they are retried until one succeeds); Retry tries at once. Why it
|
||||
/// failed is one localized sentence (BRIEF §0.2 rule 6); the exception's own text is in the log.
|
||||
/// </summary>
|
||||
private void OnSaveFailed(Exception ex) => Shell.ShowToast(new Toast
|
||||
{
|
||||
Title = Loc.L("Editor.Save.Failed"),
|
||||
Message = ex.Message,
|
||||
Message = Session.IsRemote ? ErrorText.ForServer(ex) : ArchiveFailures.Cause(ex),
|
||||
IsError = true,
|
||||
ActionText = Loc.L("Editor.Save.Retry"),
|
||||
ActionToolTip = Loc.L("Tooltips.Editor.Save.Retry"),
|
||||
|
||||
Reference in new issue
Block a user