Skip to content

Commit bd09cbd

Browse files
committed
fix(cli): improve error message for internal errors
1 parent f48f117 commit bd09cbd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/vectorcode/lsp_main.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
import os
55
import sys
66
import time
7+
import traceback
78
import uuid
89

9-
from pygls.exceptions import (
10-
JsonRpcException,
11-
JsonRpcInternalError,
12-
JsonRpcInvalidRequest,
13-
)
14-
1510
try: # pragma: nocover
1611
from lsprotocol import types
12+
from pygls.exceptions import (
13+
JsonRpcException,
14+
JsonRpcInternalError,
15+
JsonRpcInvalidRequest,
16+
)
1717
from pygls.server import LanguageServer
1818
except ModuleNotFoundError: # pragma: nocover
1919
print(
@@ -166,7 +166,7 @@ async def execute_command(ls: LanguageServer, args: list[str]):
166166
raise
167167
else: # pragma: nocover
168168
# wrap non-pygls errors for error codes.
169-
raise JsonRpcInternalError(e.__traceback__) from e
169+
raise JsonRpcInternalError(message=traceback.format_exc()) from e
170170

171171

172172
async def lsp_start() -> int:

0 commit comments

Comments
 (0)