Skip to content

Commit

Permalink
handles logging exception
Browse files Browse the repository at this point in the history
  • Loading branch information
akash-plane committed Dec 11, 2024
1 parent 6226613 commit 954fd2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apiserver/plane/app/views/external/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
WorkspaceLiteSerializer)
from plane.db.models import Project, Workspace
from plane.license.utils.instance_value import get_configuration_value
from plane.utils.exception_logger import log_exception

from ..base import BaseAPIView

Expand Down Expand Up @@ -48,7 +49,8 @@ def get_gpt_response(task, prompt, api_key, engine):
text = response.choices[0].message.content.strip()
return text, None
except Exception as e:
return None, str(e)
log_exception(e)
return None, "Error has occurred while generating reponse from OpenAI GPT"


class GPTIntegrationEndpoint(BaseAPIView):
Expand Down

0 comments on commit 954fd2f

Please sign in to comment.