diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2025-08-01 17:02:14 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2025-08-01 20:56:33 -0400 |
| commit | 15c635b873105eda2861430d062ea3f6bdfe9d9b (patch) | |
| tree | f5b17f7aa1388660992e233b3711654aad0cfb0c /python/filemetadata.py | |
| parent | 24fef31b14b89198185e5edc39ab7e6a7ef2e9ba (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/filemetadata.py')
| -rw-r--r-- | python/filemetadata.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/filemetadata.py b/python/filemetadata.py index 651de470..fd1fc328 100644 --- a/python/filemetadata.py +++ b/python/filemetadata.py @@ -27,7 +27,7 @@ import binaryninja from . import _binaryninjacore as core from .enums import SaveOption from . import associateddatastore #required for _FileMetadataAssociatedDataStore -from .log import log_error +from .log import log_error_for_exception from . import binaryview from . import database from . import deprecation @@ -51,7 +51,7 @@ class NavigationHandler: try: view = self.get_current_view() except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in NavigationHandler._get_current_view") view = "" return core.BNAllocString(view) @@ -59,14 +59,14 @@ class NavigationHandler: try: return self.get_current_offset() except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in NavigationHandler._get_current_offset") return 0 def _navigate(self, ctxt: Any, view: ViewName, offset: int) -> bool: try: return self.navigate(view, offset) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in NavigationHandler._navigate") return False def get_current_view(self) -> str: |
