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/fileaccessor.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/fileaccessor.py')
| -rw-r--r-- | python/fileaccessor.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/fileaccessor.py b/python/fileaccessor.py index bc7024d6..9bf0eb85 100644 --- a/python/fileaccessor.py +++ b/python/fileaccessor.py @@ -23,7 +23,7 @@ import ctypes # Binary Ninja components from . import _binaryninjacore as core -from .log import log_error +from .log import log_error_for_exception class FileAccessor: @@ -50,7 +50,7 @@ class FileAccessor: try: return self.get_length() except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in FileAccessor._get_length") return 0 def _read(self, ctxt, dest, offset, length): @@ -63,7 +63,7 @@ class FileAccessor: ctypes.memmove(dest, data, len(data)) return len(data) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in FileAccessor._read") return 0 def _write(self, ctxt, offset, src, length): @@ -72,7 +72,7 @@ class FileAccessor: ctypes.memmove(data, src, length) return self.write(offset, data.raw) except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in FileAccessor._write") return 0 |
