summaryrefslogtreecommitdiff
path: root/python/typearchive.py
diff options
context:
space:
mode:
authorRusty Wagner <rusty.wagner@gmail.com>2025-08-01 17:02:14 -0400
committerRusty Wagner <rusty.wagner@gmail.com>2025-08-01 20:56:33 -0400
commit15c635b873105eda2861430d062ea3f6bdfe9d9b (patch)
treef5b17f7aa1388660992e233b3711654aad0cfb0c /python/typearchive.py
parent24fef31b14b89198185e5edc39ab7e6a7ef2e9ba (diff)
Use log_error_for_exception in the Python API to pass tracebacks in the stack trace associated with log messages, instead of creating large mutli-line messages for every exception
Diffstat (limited to 'python/typearchive.py')
-rw-r--r--python/typearchive.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/typearchive.py b/python/typearchive.py
index bc2dea7a..0085fe10 100644
--- a/python/typearchive.py
+++ b/python/typearchive.py
@@ -771,25 +771,25 @@ class TypeArchiveNotificationCallbacks:
try:
self._notify.type_added(self._archive, core.pyNativeStr(id), _types.Type.create(handle=core.BNNewTypeReference(definition)))
except:
- log.log_error(traceback.format_exc())
+ log.log_error_for_exception("Unhandled Python exception in TypeArchiveNotificationCallbacks._type_added")
def _type_updated(self, ctxt, archive: ctypes.POINTER(core.BNTypeArchive), id: ctypes.c_char_p, old_definition: ctypes.POINTER(core.BNType), new_definition: ctypes.POINTER(core.BNType)) -> None:
try:
self._notify.type_updated(self._archive, core.pyNativeStr(id), _types.Type.create(handle=core.BNNewTypeReference(old_definition)), _types.Type.create(handle=core.BNNewTypeReference(new_definition)))
except:
- log.log_error(traceback.format_exc())
+ log.log_error_for_exception("Unhandled Python exception in TypeArchiveNotificationCallbacks._type_updated")
def _type_renamed(self, ctxt, archive: ctypes.POINTER(core.BNTypeArchive), id: ctypes.c_char_p, old_name: ctypes.POINTER(core.BNQualifiedName), new_name: ctypes.POINTER(core.BNQualifiedName)) -> None:
try:
self._notify.type_renamed(self._archive, core.pyNativeStr(id), _types.QualifiedName._from_core_struct(old_name.contents), _types.QualifiedName._from_core_struct(new_name.contents))
except:
- log.log_error(traceback.format_exc())
+ log.log_error_for_exception("Unhandled Python exception in TypeArchiveNotificationCallbacks._type_renamed")
def _type_deleted(self, ctxt, archive: ctypes.POINTER(core.BNTypeArchive), id: ctypes.c_char_p, definition: ctypes.POINTER(core.BNType)) -> None:
try:
self._notify.type_deleted(self._archive, core.pyNativeStr(id), _types.Type.create(handle=core.BNNewTypeReference(definition)))
except:
- log.log_error(traceback.format_exc())
+ log.log_error_for_exception("Unhandled Python exception in TypeArchiveNotificationCallbacks._type_deleted")
@property
def archive(self) -> 'TypeArchive':