Skip to content

Commit c3a9561

Browse files
committed
Updated InsufficientBalanceError docstring and set another flag for fastapi responses
1 parent 9395c2c commit c3a9561

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

archipy/helpers/utils/app_utils.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,18 @@ def create_fastapi_app(
230230
config: BaseConfig | None = None,
231231
*,
232232
configure_exception_handlers: bool = True,
233+
configure_common_responses: bool = True,
233234
lifespan: Callable[..., AbstractAsyncContextManager] | None = None,
234235
) -> FastAPI:
235-
"""Creates and configures a FastAPI application.
236+
"""Create and configure a FastAPI application.
236237
237238
Args:
238-
config (BaseConfig | None): Optional custom configuration. If not provided, uses global config.
239-
configure_exception_handlers (bool): Whether to configure exception handlers.
240-
lifespan: Callable[..., AbstractAsyncContextManager] | None = None,
239+
config (BaseConfig | None, optional): Custom configuration. If not provided, uses global config.
240+
configure_exception_handlers (bool, optional): Whether to configure exception handlers. Defaults to True.
241+
configure_common_responses (bool, optional): Whether to configure common response definitions for all endpoints.
242+
Defaults to True.
243+
lifespan (Callable[..., AbstractAsyncContextManager] | None, optional): Custom lifespan context manager for the app.
244+
Defaults to None.
241245
242246
Returns:
243247
FastAPI: The configured FastAPI application instance.
@@ -255,7 +259,7 @@ def create_fastapi_app(
255259
swagger_ui_parameters=config.FASTAPI.SWAGGER_UI_PARAMS,
256260
docs_url=config.FASTAPI.DOCS_URL,
257261
redocs_url=config.FASTAPI.RE_DOCS_URL,
258-
responses=cast(dict[int | str, Any], common_responses) if configure_exception_handlers else None,
262+
responses=cast(dict[int | str, Any], common_responses) if configure_common_responses else None,
259263
lifespan=lifespan,
260264
)
261265

archipy/models/errors/custom_errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ def __init__(
643643

644644

645645
class InsufficientBalanceError(BaseError):
646-
"""Exception raised when a password does not meet the security requirements."""
646+
"""Exception raised when an operation fails due to insufficient account balance."""
647647

648648
def __init__(
649649
self,

0 commit comments

Comments
 (0)