fix(claude-do): snake_case Serilog tokens + no Warning-log on cancelled hub calls

Message-template tokens must be snake_case (repo rule) -- fixes 4 PascalCase
tokens introduced in 57dd6766. TryInvokeAsync's swallowing catch also no
longer logs a Warning for OperationCanceledException, which is routine
(e.g. worker shutdown/reconnect), not a failure worth a trace.

ClaudeDo-Task: d2ae3831-733f-4d40-93d7-70c93da11590
This commit is contained in:
Mika Kuns
2026-09-28 13:32:38 +02:00
parent 57dd676672
commit 3009ff0f8f
4 changed files with 9 additions and 8 deletions
+2 -2
View File
@@ -50,13 +50,13 @@ sealed class Program
var version = Assembly.GetEntryAssembly()?
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion
?? "0.0.0";
Log.Information("ClaudeDo.App starting (version: {Version})", version);
Log.Information("ClaudeDo.App starting (version: {version})", version);
// Last-resort net: any exception that misses every other handler still gets one
// Fatal line in the log before the process dies.
AppDomain.CurrentDomain.UnhandledException += (_, e) =>
{
Log.Fatal(e.ExceptionObject as Exception, "Unhandled exception, terminating (IsTerminating: {IsTerminating})", e.IsTerminating);
Log.Fatal(e.ExceptionObject as Exception, "Unhandled exception, terminating (is_terminating: {is_terminating})", e.IsTerminating);
Log.CloseAndFlush();
};
TaskScheduler.UnobservedTaskException += (_, e) =>
+5 -4
View File
@@ -304,11 +304,12 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
ok = true;
return result;
}
catch (Exception ex)
catch (Exception ex) when (ex is not OperationCanceledException)
{
Serilog.Log.Warning(ex, "Hub call {Method} failed", method);
Serilog.Log.Warning(ex, "Hub call {method_name} failed", method);
return default;
}
catch { return default; }
finally { OperationTiming.Shared.Record("hub", method, sw.Elapsed, ok); }
}
@@ -324,7 +325,7 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
}
catch (Exception ex)
{
Serilog.Log.Warning(ex, "Hub call {Method} failed", method);
Serilog.Log.Warning(ex, "Hub call {method_name} failed", method);
throw;
}
finally { OperationTiming.Shared.Record("hub", method, sw.Elapsed, ok); }
@@ -343,7 +344,7 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
}
catch (Exception ex)
{
Serilog.Log.Warning(ex, "Hub call {Method} failed", method);
Serilog.Log.Warning(ex, "Hub call {method_name} failed", method);
throw;
}
finally { OperationTiming.Shared.Record("hub", method, sw.Elapsed, ok); }
@@ -209,7 +209,7 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
private void FlashFooter(string message, WorkerLogLevel level)
{
if (level == WorkerLogLevel.Error)
Serilog.Log.Warning("Footer error: {Message}", message);
Serilog.Log.Warning("Footer error: {message}", message);
WorkerLogText = $"{DateTime.Now:HH:mm} · {message}";
WorkerLogLevel = level;
@@ -20,7 +20,7 @@ public sealed class HubExceptionLoggingFilter(ILogger<HubExceptionLoggingFilter>
}
catch (Exception ex)
{
logger.LogWarning(ex, "Hub method {Method} failed", invocationContext.HubMethodName);
logger.LogWarning(ex, "Hub method {method_name} failed", invocationContext.HubMethodName);
throw;
}
}