Added logic to remove supported languages that are no longer supported, rather than just being purely additive. Added ApiClient logging.
All checks were successful
ci / build-test (push) Successful in 2m30s
ci / publish-image (push) Successful in 2m1s

This commit is contained in:
2026-03-30 23:03:53 -04:00
parent 0dd11e6351
commit adfbf654a6
6 changed files with 91 additions and 4 deletions

View File

@@ -22,8 +22,21 @@ public abstract class ApiClient(HttpClient http, ILogger logger, JsonSerializerO
Stream stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
return await JsonSerializer.DeserializeAsync<TResponse>(stream, json, cancellationToken).ConfigureAwait(false)
?? throw new InvalidOperationException($"Failed to deserialize JSON to {typeof(TResponse).Name} from {url}.");
try
{
return await JsonSerializer.DeserializeAsync<TResponse>(stream, json, cancellationToken).ConfigureAwait(false)
?? throw new InvalidOperationException($"Failed to deserialize JSON to {typeof(TResponse).Name} from {url}.");
}
catch (JsonException ex)
{
logger.LogError(ex,
"Failed to deserialize JSON from {Url}. ContentLengthHeader={ContentLengthHeader}",
url,
response.Content.Headers.ContentLength);
throw;
}
}
protected async Task<TResponse> GetJsonpAsync<TResponse>(