Skip to content

Commit

Permalink
log traceback of lsp handler
Browse files Browse the repository at this point in the history
  • Loading branch information
mitya52 authored and olegklimov committed Mar 13, 2024
1 parent c14824a commit 70d39fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion refact_webgui/webgui/selfhost_lsp_proxy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import json
import httpx
import traceback

from fastapi import APIRouter
from fastapi.exceptions import HTTPException
Expand All @@ -10,6 +11,7 @@
from starlette.background import BackgroundTask

from refact_utils.scripts import env
from refact_webgui.webgui.selfhost_webutils import log_error
from refact_webgui.webgui.selfhost_login import RefactSession

__all__ = ["LspProxy"]
Expand Down Expand Up @@ -41,7 +43,8 @@ def __init__(self, session: RefactSession, *args, **kwargs):
async def _account_from_bearer(self, authorization: str) -> str:
try:
return self._session.header_authenticate(authorization)
except BaseException as e:
except Exception as e:
log_error(traceback.format_exc())
raise HTTPException(status_code=401, detail=str(e))

async def _reverse_proxy_chat(self, request: Request):
Expand Down
1 change: 1 addition & 0 deletions refact_webgui/webgui/selfhost_webutils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging

log = logging.getLogger("WEBUI").info
log_error = logging.getLogger("WEBUI").error

0 comments on commit 70d39fd

Please sign in to comment.