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/typeparser.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/typeparser.py')
| -rw-r--r-- | python/typeparser.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/python/typeparser.py b/python/typeparser.py index fc7f5630..e44d13b5 100644 --- a/python/typeparser.py +++ b/python/typeparser.py @@ -37,7 +37,7 @@ from . import platform from . import typecontainer from . import types from . import deprecation -from .log import log_error +from .log import log_error_for_exception from .enums import TypeParserErrorSeverity, TypeParserOption @@ -255,7 +255,7 @@ class TypeParser(metaclass=_TypeParserMetaclass): result[0] = TypeParser._cached_string return True except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in TypeParser._get_option_text") return False def _preprocess_source( @@ -299,7 +299,7 @@ class TypeParser(metaclass=_TypeParserMetaclass): return output_py is not None except: errorCount[0] = 0 - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in TypeParser._preprocess_source") return False def _parse_types_from_source( @@ -350,7 +350,7 @@ class TypeParser(metaclass=_TypeParserMetaclass): result[0].variableCount = 0 result[0].functionCount = 0 errorCount[0] = 0 - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in TypeParser._parse_types_from_source") return False def _parse_type_string( @@ -384,7 +384,7 @@ class TypeParser(metaclass=_TypeParserMetaclass): return result_py is not None except: errorCount[0] = 0 - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in TypeParser._parse_type_string") return False def _free_string( @@ -394,7 +394,7 @@ class TypeParser(metaclass=_TypeParserMetaclass): TypeParser._cached_string = None return True except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in TypeParser._free_string") return False def _free_result( @@ -411,7 +411,7 @@ class TypeParser(metaclass=_TypeParserMetaclass): TypeParser._cached_result = None return True except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in TypeParser._free_result") return False def _free_error_list( @@ -421,7 +421,7 @@ class TypeParser(metaclass=_TypeParserMetaclass): TypeParser._cached_error = None return True except: - log_error(traceback.format_exc()) + log_error_for_exception("Unhandled Python exception in TypeParser._free_error_list") return False def get_option_text(self, option: TypeParserOption, value: str) -> Optional[str]: |
