mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-27 20:44:00 +02:00
Fixed: (FL) Improve error message for service unavailable
This commit is contained in:
@@ -38,3 +38,8 @@ public class FileListTorrent
|
|||||||
[JsonPropertyName("small_description")]
|
[JsonPropertyName("small_description")]
|
||||||
public string SmallDescription { get; set; }
|
public string SmallDescription { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class FileListErrorResponse
|
||||||
|
{
|
||||||
|
public string Error { get; set; }
|
||||||
|
}
|
||||||
|
@@ -28,9 +28,14 @@ public class FileListParser : IParseIndexerResponse
|
|||||||
throw new IndexerException(indexerResponse, "Unexpected response status {0} code from indexer request", indexerResponse.HttpResponse.StatusCode);
|
throw new IndexerException(indexerResponse, "Unexpected response status {0} code from indexer request", indexerResponse.HttpResponse.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (indexerResponse.Content.StartsWith("{\"error2\"") && STJson.TryDeserialize<FileListErrorResponse>(indexerResponse.Content, out var errorResponse))
|
||||||
|
{
|
||||||
|
throw new IndexerException(indexerResponse, "Unexpected response from indexer request: {0}", errorResponse.Error);
|
||||||
|
}
|
||||||
|
|
||||||
if (!indexerResponse.HttpResponse.Headers.ContentType.Contains(HttpAccept.Json.Value))
|
if (!indexerResponse.HttpResponse.Headers.ContentType.Contains(HttpAccept.Json.Value))
|
||||||
{
|
{
|
||||||
throw new IndexerException(indexerResponse, $"Unexpected response header {indexerResponse.HttpResponse.Headers.ContentType} from indexer request, expected {HttpAccept.Json.Value}");
|
throw new IndexerException(indexerResponse, "Unexpected response header {0} from indexer request, expected {1}", indexerResponse.HttpResponse.Headers.ContentType, HttpAccept.Json.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
var releaseInfos = new List<ReleaseInfo>();
|
var releaseInfos = new List<ReleaseInfo>();
|
||||||
|
Reference in New Issue
Block a user