@@ -210,7 +210,7 @@ def __init__(
210
210
self ,
211
211
status_code : int ,
212
212
content_type : Optional [str ] = None ,
213
- body : Union [str , bytes , None ] = None ,
213
+ body : Union [Any , None ] = None ,
214
214
headers : Optional [Dict [str , Union [str , List [str ]]]] = None ,
215
215
cookies : Optional [List [Cookie ]] = None ,
216
216
compress : Optional [bool ] = None ,
@@ -1317,7 +1317,7 @@ def __init__(
1317
1317
self ._strip_prefixes = strip_prefixes
1318
1318
self .context : Dict = {} # early init as customers might add context before event resolution
1319
1319
self .processed_stack_frames = []
1320
- self .response_builder_class = ResponseBuilder
1320
+ self ._response_builder_class = ResponseBuilder
1321
1321
1322
1322
# Allow for a custom serializer or a concise json serialization
1323
1323
self ._serializer = serializer or partial (json .dumps , separators = ("," , ":" ), cls = Encoder )
@@ -1875,9 +1875,9 @@ def _not_found(self, method: str) -> ResponseBuilder:
1875
1875
1876
1876
handler = self ._lookup_exception_handler (NotFoundError )
1877
1877
if handler :
1878
- return self .response_builder_class (handler (NotFoundError ()))
1878
+ return self ._response_builder_class (handler (NotFoundError ()))
1879
1879
1880
- return self .response_builder_class (
1880
+ return self ._response_builder_class (
1881
1881
Response (
1882
1882
status_code = HTTPStatus .NOT_FOUND .value ,
1883
1883
content_type = content_types .APPLICATION_JSON ,
@@ -1892,7 +1892,7 @@ def _call_route(self, route: Route, route_arguments: Dict[str, str]) -> Response
1892
1892
# Reset Processed stack for Middleware (for debugging purposes)
1893
1893
self ._reset_processed_stack ()
1894
1894
1895
- return self .response_builder_class (
1895
+ return self ._response_builder_class (
1896
1896
self ._to_response (
1897
1897
route (router_middlewares = self ._router_middlewares , app = self , route_arguments = route_arguments ),
1898
1898
),
@@ -1909,7 +1909,7 @@ def _call_route(self, route: Route, route_arguments: Dict[str, str]) -> Response
1909
1909
# If the user has turned on debug mode,
1910
1910
# we'll let the original exception propagate, so
1911
1911
# they get more information about what went wrong.
1912
- return self .response_builder_class (
1912
+ return self ._response_builder_class (
1913
1913
Response (
1914
1914
status_code = 500 ,
1915
1915
content_type = content_types .TEXT_PLAIN ,
@@ -1948,12 +1948,12 @@ def _call_exception_handler(self, exp: Exception, route: Route) -> Optional[Resp
1948
1948
handler = self ._lookup_exception_handler (type (exp ))
1949
1949
if handler :
1950
1950
try :
1951
- return self .response_builder_class (handler (exp ), route )
1951
+ return self ._response_builder_class (handler (exp ), route )
1952
1952
except ServiceError as service_error :
1953
1953
exp = service_error
1954
1954
1955
1955
if isinstance (exp , ServiceError ):
1956
- return self .response_builder_class (
1956
+ return self ._response_builder_class (
1957
1957
Response (
1958
1958
status_code = exp .status_code ,
1959
1959
content_type = content_types .APPLICATION_JSON ,
0 commit comments