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/transform.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/transform.py')
| -rw-r--r-- | python/transform.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/python/transform.py b/python/transform.py index c19a7cb1..54641f91 100644 --- a/python/transform.py +++ b/python/transform.py @@ -24,7 +24,7 @@ import abc # Binary Ninja components import binaryninja -from .log import log_error +from .log import log_error_for_exception from . import databuffer from . import _binaryninjacore as core from .enums import TransformType @@ -179,7 +179,7 @@ class Transform(metaclass=_TransformMetaClass): self._pending_param_lists[result.value] = (result, param_buf) return result.value except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in Transform._get_parameters") count[0] = 0 return None @@ -190,7 +190,7 @@ class Transform(metaclass=_TransformMetaClass): raise ValueError("freeing parameter list that wasn't allocated") del self._pending_param_lists[buf.value] except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in Transform._free_parameters") def _decode(self, ctxt, input_buf, output_buf, params, count): try: @@ -206,7 +206,7 @@ class Transform(metaclass=_TransformMetaClass): core.BNSetDataBufferContents(output_buf, result, len(result)) return True except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in Transform._decode") return False def _encode(self, ctxt, input_buf, output_buf, params, count): @@ -223,7 +223,7 @@ class Transform(metaclass=_TransformMetaClass): core.BNSetDataBufferContents(output_buf, result, len(result)) return True except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in Transform._encode") return False @abc.abstractmethod |
