fix: exclude HTTP 408 from permanent delivery errors
This commit is contained in:
parent
a9fa0064d7
commit
5a0369197e
@ -61,4 +61,13 @@ describe("isPermanentDeliveryError", () => {
|
||||
it("returns false for timeout errors", () => {
|
||||
expect(isPermanentDeliveryError("request timed out")).toBe(false);
|
||||
});
|
||||
|
||||
// 408 should NOT be permanent (request timeout = transient)
|
||||
it("does NOT treat HTTP 408 as permanent", () => {
|
||||
expect(isPermanentDeliveryError("status 408")).toBe(false);
|
||||
});
|
||||
|
||||
it("does NOT treat HTTP 408 Request Timeout as permanent", () => {
|
||||
expect(isPermanentDeliveryError("HTTP 408 Request Timeout")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@ -452,7 +452,7 @@ export function isPermanentDeliveryError(error: string): boolean {
|
||||
const statusMatch = HTTP_STATUS_PATTERN.exec(error);
|
||||
if (statusMatch) {
|
||||
const status = parseInt(statusMatch[1], 10);
|
||||
if (status >= 400 && status < 500 && status !== 429) {
|
||||
if (status >= 400 && status < 500 && status !== 429 && status !== 408) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user