Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HH-220491 proxy 569 status #717

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions frontik/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import time
from asyncio import Task
from asyncio.futures import Future
from http import HTTPStatus
from typing import TYPE_CHECKING, Any, Optional, Type, TypeVar, Union, overload

from fastapi import Depends, HTTPException, Request, Response
Expand All @@ -28,7 +29,7 @@
from frontik.auth import DEBUG_AUTH_HEADER_NAME
from frontik.debug import DEBUG_HEADER_NAME, DebugMode, DebugTransform
from frontik.futures import AbortAsyncGroup, AsyncGroup
from frontik.http_status import ALLOWED_STATUSES
from frontik.http_status import ALLOWED_STATUSES, NON_CRITICAL_BAD_GATEWAY
from frontik.json_builder import FrontikJsonDecodeError, json_decode
from frontik.loggers import CUSTOM_JSON_EXTRA, JSON_REQUESTS_LOGGER
from frontik.loggers.stages import StagesLogger
Expand Down Expand Up @@ -550,7 +551,9 @@ async def delete_page_fail_fast(self, request_result: RequestResult) -> tuple[in
return await self.__return_error(request_result.status_code, error_info={'is_fail_fast': True})

async def __return_error(self, response_code: int, **kwargs: Any) -> tuple[int, dict, Any]:
return await self.send_error(response_code if 300 <= response_code < 500 else 502, **kwargs)
if 300 <= response_code < 500 or response_code == NON_CRITICAL_BAD_GATEWAY:
return await self.send_error(response_code, **kwargs)
return await self.send_error(HTTPStatus.BAD_GATEWAY, **kwargs)

# Finish page

Expand Down
Loading