Skip to content

Standardize request handlers, esp exception handling #61

Description

@dennyabrain

Which feature or component needs enhancement?
All request handlers associated with routes.

Describe the current behavior
There are route handlers that only have the happy path of a request handling flow.
For instance

@router.post(
"/",
description=load_description("ban_lists/create_ban_list.md"),
response_model=APIResponse[BanListResponse],
)
def create_ban_list(
payload: BanListCreate,
session: SessionDep,
auth: MultitenantAuthDep,
):
ban_list = ban_list_crud.create(
session, payload, auth.organization_id, auth.project_id
)
return APIResponse.success_response(data=ban_list)

Describe the enhancement you'd like
Finalize a syntax for status response messages and the amount of information to include in them and start adding some exception handlers to the request handler functions.

Why is this enhancement needed?
The kaapi team and any downstream API users of kaapi API will get meaningful error messages.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions