From 4bdca2d906acc9c563d388e0b64f3495220856e7 Mon Sep 17 00:00:00 2001 From: Rafael Oliveira Date: Tue, 1 Sep 2026 10:38:27 +0100 Subject: [PATCH] Removed RequestEntityTooLarge custom response --- src/Textkernel.Tx.SDK.Tests/IntegrationTests/ParsingTests.cs | 5 +++-- src/Textkernel.Tx.SDK/Services/ServiceBase.cs | 5 ----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Textkernel.Tx.SDK.Tests/IntegrationTests/ParsingTests.cs b/src/Textkernel.Tx.SDK.Tests/IntegrationTests/ParsingTests.cs index 45713f82..fa55cda8 100644 --- a/src/Textkernel.Tx.SDK.Tests/IntegrationTests/ParsingTests.cs +++ b/src/Textkernel.Tx.SDK.Tests/IntegrationTests/ParsingTests.cs @@ -15,6 +15,7 @@ using Textkernel.Tx.Models.Resume.Metadata; using System; using System.Collections; +using System.Linq; using System.IO; using System.Text.Json; using System.Threading.Tasks; @@ -43,13 +44,13 @@ public async Task TestParseBadInput(Document document, Type expectedExceptionTyp } [Test] - public void TestLargeDocumentParse() + public void TestLLMLargeDocumentParse() { TxException e = Assert.ThrowsAsync(async () => { await Client.Parser.ParseResume(new ParseRequest(new Document(new byte[20_000_000], DateTime.Now))); }); - Assert.AreEqual(e.Message, "Request body was too large."); + Assert.IsTrue(e.Message.StartsWith("Request is too large to be processed by the server. Please do not send requests larger than")); } [Test] diff --git a/src/Textkernel.Tx.SDK/Services/ServiceBase.cs b/src/Textkernel.Tx.SDK/Services/ServiceBase.cs index 8f8dc955..f6dcdbbb 100644 --- a/src/Textkernel.Tx.SDK/Services/ServiceBase.cs +++ b/src/Textkernel.Tx.SDK/Services/ServiceBase.cs @@ -65,11 +65,6 @@ internal static async Task GetBodyIfDebug(HttpRequestMessage request) internal static async Task ProcessResponse(HttpResponseMessage response, HttpRequestMessage request) where T : ITxResponse { - if (response != null && response.StatusCode == System.Net.HttpStatusCode.RequestEntityTooLarge) - { - throw new TxException(await GetBodyIfDebug(request), response, new ApiResponseInfoLite { Code = "Error", Message = "Request body was too large." }, null); - } - T data = await DeserializeBody(response); if (response != null && data == null)