diff --git a/backend/danswer/danswerbot/slack/handlers/handle_regular_answer.py b/backend/danswer/danswerbot/slack/handlers/handle_regular_answer.py index 5bd920c4b6c..e864d92c702 100644 --- a/backend/danswer/danswerbot/slack/handlers/handle_regular_answer.py +++ b/backend/danswer/danswerbot/slack/handlers/handle_regular_answer.py @@ -5,7 +5,6 @@ from typing import Optional from typing import TypeVar -from fastapi import HTTPException from retry import retry from slack_sdk import WebClient from slack_sdk.models.blocks import DividerBlock @@ -155,11 +154,7 @@ def _get_answer(new_message_request: DirectQARequest) -> OneShotQAResponse | Non with Session(get_sqlalchemy_engine()) as db_session: if len(new_message_request.messages) > 1: if new_message_request.persona_config: - raise HTTPException( - status_code=403, - detail="Slack bot does not support persona config", - ) - + raise RuntimeError("Slack bot does not support persona config") elif new_message_request.persona_id is not None: persona = cast( Persona, @@ -170,6 +165,10 @@ def _get_answer(new_message_request: DirectQARequest) -> OneShotQAResponse | Non get_editable=False, ), ) + else: + raise RuntimeError( + "No persona id provided, this should never happen." + ) llm, _ = get_llms_for_persona(persona)