Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9627d1b920 |
No files matched your search
@@ -241,6 +241,13 @@ under a `## [x.y.z] - date` heading in the same commit that bumps `VERSION`, the
|
||||
|
||||
### Fixed
|
||||
|
||||
- **A start that fails says so on screen (2026-09-15).** When `App.RunAsync` caught its own exception — a ledger
|
||||
that would not open (a newer schema, a locked file), a host that would not start — FrameLedger wrote a Fatal line to
|
||||
`ui-*.log` and exited with code 1 with nothing on screen, so a user saw a click do nothing. It now shows
|
||||
`StartupFailureDialog`, a Win32 message box like the crash dialog (the shell is what failed): the exception's message,
|
||||
the log folder, and Yes to open that folder; the exit code is still 1, and a crash the dispatcher already reported
|
||||
shows no second dialog. Two strings (en/vi/ja). Tests: `StartupFailureDialogTests`. Docs: `10_LOGGING` §Crash
|
||||
handling.
|
||||
- **Bug bundles no longer carry the user's name in log paths, which the privacy policy already promised
|
||||
(2026-09-15).** `legal/PRIVACY_POLICY.md` §3 says "logs are redacted (user directory paths removed) before
|
||||
bundling" and `10_LOGGING` named a `RedactingEnricher`; neither existed, and `BugBundleBuilder` copied `ui-*.log`,
|
||||
|
||||
@@ -33,7 +33,10 @@
|
||||
> `AppDomain.UnhandledException` (any other thread) is Fatal + dump only: the runtime is already ending the process and
|
||||
> no dialog can be relied on to appear, so the next bug report offers that dump instead. An unobserved task stays an
|
||||
> Error line. A startup failure `RunAsync` catches itself (the ledger will not open, the host will not start) is not an
|
||||
> unhandled exception: it is still a Fatal line and exit code 1 with no dialog.
|
||||
> unhandled exception: ~~it is still a Fatal line and exit code 1 with no dialog~~ **since 2026-09-15 it is the Fatal
|
||||
> line and `Services/StartupFailureDialog`**, a Win32 message box with the exception's message and the log folder, whose
|
||||
> Yes opens that folder; exit code 1 either way. Until then nothing on screen said FrameLedger had even tried to start.
|
||||
> Tests: `StartupFailureDialogTests`.
|
||||
>
|
||||
> **The Agent** (no window, so no dialog): the same Fatal + dump from `AppDomain.UnhandledException` and from `Main`'s
|
||||
> own catch, once per process whichever sees it first, then the exception stays unhandled, so the exit is the runtime's
|
||||
|
||||
@@ -103,6 +103,13 @@ public partial class App : System.Windows.Application
|
||||
{
|
||||
Log.Fatal(ex, "ui: the run ended in an exception");
|
||||
exitCode = 1;
|
||||
|
||||
// 10_LOGGING §Crash handling: a start that fails is said on screen, not only in the log. A crash the dispatcher
|
||||
// already reported has had its dialog.
|
||||
if (!_crashes.Crashed)
|
||||
{
|
||||
StartupFailureDialog.Show(ex, UiPaths.Logs);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// What a start that fails says on screen (<c>10_LOGGING</c> §Crash handling, 2026-09-15). Until then a ledger that would
|
||||
/// not open or a host that would not start was a Fatal line in <c>ui-*.log</c> and a silent exit: nothing told the user
|
||||
/// FrameLedger had even tried. A Win32 message box, like the crash dialog, because the shell is what failed to start.
|
||||
/// It gives the reason and the log folder, and Yes opens that folder; FrameLedger exits with code 1 either way.
|
||||
/// </summary>
|
||||
internal static class StartupFailureDialog
|
||||
{
|
||||
public static void Show(Exception exception, string logsDirectory)
|
||||
{
|
||||
if (MessageBox.Show(Body(exception, logsDirectory), Strings.StartupFailed_Title, MessageBoxButton.YesNo, MessageBoxImage.Error, MessageBoxResult.Yes) != MessageBoxResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using Process? _ = Process.Start(new ProcessStartInfo("explorer.exe", logsDirectory) { UseShellExecute = true });
|
||||
}
|
||||
catch (Exception ex) when (ex is Win32Exception or InvalidOperationException)
|
||||
{
|
||||
Serilog.Log.Warning(ex, "ui: the logs folder could not be opened after the failed start");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The dialog's text: the exception's own message and the folder its whole record is in.</summary>
|
||||
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format string is a resource that follows the UI culture")]
|
||||
public static string Body(Exception exception, string logsDirectory)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(exception);
|
||||
return string.Format(CultureInfo.CurrentCulture, Strings.StartupFailed_Body_Format, exception.Message, logsDirectory);
|
||||
}
|
||||
}
|
||||
Generated
+6
@@ -477,6 +477,8 @@ public static class Strings
|
||||
nameof(Settings_VkLayer_Unknown),
|
||||
nameof(Settings_VkLayer_Unregister),
|
||||
nameof(Settings_Window_Header),
|
||||
nameof(StartupFailed_Body_Format),
|
||||
nameof(StartupFailed_Title),
|
||||
nameof(Summary_Annotations_Header),
|
||||
nameof(Summary_Crash_Body),
|
||||
nameof(Summary_Crash_Title),
|
||||
@@ -1484,6 +1486,10 @@ public static class Strings
|
||||
|
||||
public static string Settings_Window_Header => ResourceManager.GetString(nameof(Settings_Window_Header), Culture) ?? nameof(Settings_Window_Header);
|
||||
|
||||
public static string StartupFailed_Body_Format => ResourceManager.GetString(nameof(StartupFailed_Body_Format), Culture) ?? nameof(StartupFailed_Body_Format);
|
||||
|
||||
public static string StartupFailed_Title => ResourceManager.GetString(nameof(StartupFailed_Title), Culture) ?? nameof(StartupFailed_Title);
|
||||
|
||||
public static string Summary_Annotations_Header => ResourceManager.GetString(nameof(Summary_Annotations_Header), Culture) ?? nameof(Summary_Annotations_Header);
|
||||
|
||||
public static string Summary_Crash_Body => ResourceManager.GetString(nameof(Summary_Crash_Body), Culture) ?? nameof(Summary_Crash_Body);
|
||||
|
||||
@@ -2237,4 +2237,19 @@
|
||||
<value>続行</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="StartupFailed_Title" xml:space="preserve">
|
||||
<value>FrameLedger を起動できませんでした</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="StartupFailed_Body_Format" xml:space="preserve">
|
||||
<value>FrameLedger は起動中にエラーが発生したため、終了します:
|
||||
|
||||
{0}
|
||||
|
||||
詳細はログフォルダーにあります:
|
||||
{1}
|
||||
|
||||
ログフォルダーを開きますか?</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1685,4 +1685,17 @@ Open the bug report now? It shows you every file in the zip, sends nothing by it
|
||||
<data name="BugReport_Options_Continue" xml:space="preserve">
|
||||
<value>Continue</value>
|
||||
</data>
|
||||
<data name="StartupFailed_Title" xml:space="preserve">
|
||||
<value>FrameLedger could not start</value>
|
||||
</data>
|
||||
<data name="StartupFailed_Body_Format" xml:space="preserve">
|
||||
<value>FrameLedger hit an error while starting and will close:
|
||||
|
||||
{0}
|
||||
|
||||
The details are in the log folder:
|
||||
{1}
|
||||
|
||||
Open the log folder?</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1680,4 +1680,17 @@ Mở báo cáo lỗi ngay bây giờ? Báo cáo cho bạn xem mọi tệp trong
|
||||
<data name="BugReport_Options_Continue" xml:space="preserve">
|
||||
<value>Tiếp tục</value>
|
||||
</data>
|
||||
<data name="StartupFailed_Title" xml:space="preserve">
|
||||
<value>FrameLedger không khởi động được</value>
|
||||
</data>
|
||||
<data name="StartupFailed_Body_Format" xml:space="preserve">
|
||||
<value>FrameLedger gặp lỗi khi khởi động và sẽ đóng lại:
|
||||
|
||||
{0}
|
||||
|
||||
Chi tiết nằm trong thư mục log:
|
||||
{1}
|
||||
|
||||
Mở thư mục log?</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,20 @@
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Services;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>A failed start says why and where the log is (<c>10_LOGGING</c> §Crash handling, 2026-09-15).</summary>
|
||||
public sealed class StartupFailureDialogTests
|
||||
{
|
||||
[Fact]
|
||||
public void TheTextNamesTheReasonAndTheLogFolder()
|
||||
{
|
||||
const string logs = @"C:\data\FrameLedger\logs";
|
||||
var failure = new InvalidOperationException("ledger schema 9 is newer than this build (4)");
|
||||
|
||||
string body = StartupFailureDialog.Body(failure, logs);
|
||||
|
||||
body.Should().Contain("ledger schema 9 is newer than this build (4)").And.Contain(logs);
|
||||
body.Should().NotContain("{0}").And.NotContain("{1}");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user