8 Commits

Author SHA1 Message Date
pcjones
2370153192 Clarify error message on indexer request error 2026-02-01 17:51:47 +01:00
pcjones
79ad4f9370 Merge branch 'master' into develop 2026-02-01 17:49:30 +01:00
PCJones
2650d32ae2 Remove rid and tmdbid from text search queries 2025-11-18 10:56:05 +01:00
PCJones
5f87a596fb Fix title lookup colon workaround 2025-11-18 10:55:51 +01:00
PCJones
c2b200f3be Update docker compose 2025-11-18 10:55:25 +01:00
PCJones
6ef8cc3cd1 Merge branch 'master' into develop
Resolved conflict in TitleLookupController.cs by keeping the master version with colon handling fix.
This brings develop up to date with master (v0.7.4), including the November bug fixes.
2025-11-18 10:49:49 +01:00
PCJones
02cf2854e1 Update dependencies 2025-07-22 16:32:31 +02:00
PCJones
22ecdaa6cd Add newzbay categories; add title lookup API 2025-07-22 16:30:30 +02:00

View File

@@ -54,6 +54,7 @@ namespace UmlautAdaptarr.Services
}
await EnsureMinimumDelayAsync(targetUri);
var targetHost = new Uri(targetUri).Host;
var requestMessage = new HttpRequestMessage
{
@@ -88,7 +89,14 @@ namespace UmlautAdaptarr.Services
}
catch (Exception ex)
{
_logger.LogError(ex, $"Error proxying request: {UrlUtilities.RedactApiKey(targetUri)}. Error: {ex.Message}");
var upstreamMessage = IsTimeoutOrReset(ex)
? $"{targetHost} timed out or reset the connection. This is an error with your indexer or network, not with UmlautAdaptarr."
: $"{targetHost} request failed. This is an error with your indexer or network, not with UmlautAdaptarr.";
_logger.LogError(ex, "{UpstreamMessage} Target: {TargetUri} Error: {ErrorMessage}",
upstreamMessage,
UrlUtilities.RedactApiKey(targetUri),
ex.Message);
var errorResponse = new HttpResponseMessage(System.Net.HttpStatusCode.InternalServerError)
{
@@ -97,5 +105,26 @@ namespace UmlautAdaptarr.Services
return errorResponse;
}
}
private static bool IsTimeoutOrReset(Exception ex)
{
if (ex is TaskCanceledException)
{
return true;
}
var current = ex;
while (current != null)
{
if (current is System.Net.Sockets.SocketException socketEx)
{
return socketEx.SocketErrorCode == System.Net.Sockets.SocketError.TimedOut
|| socketEx.SocketErrorCode == System.Net.Sockets.SocketError.ConnectionReset;
}
current = current.InnerException;
}
return false;
}
}
}