From e2383ff98d4994fa2215eb47b8b0cd69775e088b Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 15 Oct 2022 15:40:20 -0500 Subject: add a hub method to handle failed uploads --- src/slskd/Network/API/Hubs/NetworkHub.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/slskd/Network/API/Hubs/NetworkHub.cs b/src/slskd/Network/API/Hubs/NetworkHub.cs index 78a658d4..6d43e6da 100644 --- a/src/slskd/Network/API/Hubs/NetworkHub.cs +++ b/src/slskd/Network/API/Hubs/NetworkHub.cs @@ -99,5 +99,13 @@ namespace slskd.Network Log.Information("Agent connection {Id} requested a share upload token, but was not registered.", Context.ConnectionId); throw new UnauthorizedAccessException(); } + + public void NotifyUploadFailed(Guid id) + { + if (Network.PendingFileUploads.TryGetValue(id, out var record)) + { + record.Stream.SetException(new NotFoundException("The file could not be uploaded from the remote agent")); + } + } } } \ No newline at end of file -- cgit v1.2.3