dw: receive errors during execution

GitOrigin-RevId: d8c41efe046684dbc0c4b1ee21298787b6edf6fe
This commit is contained in:
Alexander.Kass
2025-09-10 14:04:11 +00:00
committed by intellij-monorepo-bot
parent e18f0be314
commit e04fab7a97
5 changed files with 1009 additions and 1 deletions
@@ -13,6 +13,7 @@ from _pydevd_bundle.pydevd_comm import InternalDataViewerAction
from _pydevd_bundle.pydevd_constants import IS_JYTHON, dict_iter_items
from _pydevd_bundle.pydevd_tables import exec_table_command
from _pydevd_bundle.pydevd_tables import exec_image_table_command
from _pydevd_bundle.pydevd_tables import exec_raw
from _pydevd_bundle.pydevd_user_type_renderers import parse_set_type_renderers_message
from pydev_console.pydev_protocol import CompletionOption, CompletionOptionType, \
PythonUnhandledException, PythonTableException
@@ -432,6 +433,17 @@ class BaseInterpreterInterface(BaseCodeExecutor):
if not success:
raise PythonTableException(str(res))
#
def execRaw(self, command):
try:
success, res = exec_raw(command, self.get_namespace(), self.get_namespace())
if success:
return res
except:
traceback.print_exc()
raise PythonUnhandledException(traceback.format_exc())
if not success:
raise PythonUnhandledException(str(res))
#
def execTableImageCommand(self, command, command_type, offset, image_id):
@@ -5,7 +5,7 @@ from _pydevd_bundle import pydevd_vars
from _pydevd_bundle.pydevd_constants import NEXT_VALUE_SEPARATOR
from _pydevd_bundle.pydevd_xml import ExceptionOnEvaluate
from _pydevd_bundle.tables.images.pydevd_image_loader import load_image_chunk
from _pydev_bundle.pydev_imports import Exec
class TableCommandType:
DF_INFO = "DF_INFO"
@@ -42,6 +42,13 @@ def exec_image_table_command(init_command, command_type, offset, image_id, f_glo
return True, load_image_chunk(offset, image_id)
def exec_raw(command, f_globals, f_locals):
try:
res = Exec(command, f_globals, f_locals)
return True, str(res)
except:
return False, pydevd_vars.get_eval_exception_msg(command, f_locals).result
def exec_table_command(init_command, command_type, start_index, end_index, format, f_globals,
f_locals):
table = pydevd_vars.eval_in_context(init_command, f_globals, f_locals)
@@ -202,6 +202,8 @@ service PythonConsoleBackendService {
*/
void loadFullValue(1: LoadFullValueRequestSeq seq, 2: list<string> variables) throws (1: PythonUnhandledException unhandledException),
string execRaw(1: string command) throws (1: PythonUnhandledException unhandledException)
string execTableCommand(1: string tableVariable, 2: string commandType, 3: string startIndex, 4: string endIndex, 5: string format) throws (1: PythonUnhandledException unhandledException, 2: PythonTableException tableException)
string execTableImageCommand(1: string tableVariable, 2: string commandType, 3: string offset, 4: string imageId) throws (1: PythonUnhandledException unhandledException, 2: PythonTableException tableException)