From 2a3e057e5b3dbc7bf55c430f10ef91e036984b2b Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 15 Nov 2026 17:38:35 -0600 Subject: fix the usage of NotifyFileUploadFailed --- src/slskd/Relay/API/Hubs/RelayHub.cs | 8 ++++---- src/slskd/Relay/RelayClient.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/slskd/Relay/API/Hubs/RelayHub.cs b/src/slskd/Relay/API/Hubs/RelayHub.cs index e839cd1a..4e044bdb 100644 --- a/src/slskd/Relay/API/Hubs/RelayHub.cs +++ b/src/slskd/Relay/API/Hubs/RelayHub.cs @@ -223,9 +223,9 @@ namespace slskd.Relay /// Executed by the agent to notify the controller that the agent was unable to upload the file requested by a call to . /// /// The unique identifier of the request. - /// The Exception that caused the failure. + /// A message describing the failure. /// Thrown when the agent is not fully authenticated. - public void NotifyFileUploadFailed(Guid id, Exception exception) + public void NotifyFileUploadFailed(Guid id, string message) { if (!Relay.TryGetAgentRegistration(Context.ConnectionId, out var record)) { @@ -233,9 +233,9 @@ namespace slskd.Relay throw new UnauthorizedAccessException(); } - Log.Warning("Agent {Agent} (connection {ConnectionId}) from {IP} reported upload failure for {Id}: {Message}", record.Agent, Context.ConnectionId, GetRemoteIPAddress(), id, exception.Message); + Log.Warning("Agent {Agent} (connection {ConnectionId}) from {IP} reported upload failure for {Id}: {Message}", record.Agent.Name, Context.ConnectionId, GetRemoteIPAddress(), id, message); - Relay.NotifyFileStreamException(record.Agent.Name, id, exception); + Relay.NotifyFileStreamException(record.Agent.Name, id, new RelayException(message)); } /// diff --git a/src/slskd/Relay/RelayClient.cs b/src/slskd/Relay/RelayClient.cs index 49935b4c..63eda434 100644 --- a/src/slskd/Relay/RelayClient.cs +++ b/src/slskd/Relay/RelayClient.cs @@ -463,7 +463,7 @@ namespace slskd.Relay Log.Error(ex, "Failed to handle file request: {Message}", ex.Message); // report the failure to the controller. this avoids a failure due to timeout. - await HubConnection.InvokeAsync(nameof(RelayHub.NotifyFileUploadFailed), token); + await HubConnection.InvokeAsync(nameof(RelayHub.NotifyFileUploadFailed), token, ex.Message); } }); } -- cgit v1.2.3