diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-07-27 06:46:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-07-27 14:00:50 +0300 |
commit | 565d7f75ccfe955821991793fcd6335e58b6825b (patch) | |
tree | f5526fc547c112a6694d187504ae1ac739e1933c /source/blender/python/intern/bpy_capi_utils.h | |
parent | 7beef1fd33b37f62d14a7de7150cfc7b0d88f159 (diff) |
UI: improve errors when evaluating a number button fails
Showing the Python error without any explanation is often
not enough information and doesn't hint that the error was in the
user input.
The error report from a invalid expression such as '..1' used to be:
('invalid syntax', ('<string>', 1, 1, '..1'))
Now reads:
Error evaluating number, see Info editor for details: invalid syntax
Address issue raised by T78913.
Diffstat (limited to 'source/blender/python/intern/bpy_capi_utils.h')
-rw-r--r-- | source/blender/python/intern/bpy_capi_utils.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_capi_utils.h b/source/blender/python/intern/bpy_capi_utils.h index 97344ce1326..2d654336f8f 100644 --- a/source/blender/python/intern/bpy_capi_utils.h +++ b/source/blender/python/intern/bpy_capi_utils.h @@ -39,8 +39,10 @@ char *BPy_enum_as_string(const struct EnumPropertyItem *item); short BPy_reports_to_error(struct ReportList *reports, PyObject *exception, const bool clear); void BPy_reports_write_stdout(const struct ReportList *reports, const char *header); bool BPy_errors_to_report_ex(struct ReportList *reports, + const char *error_prefix, const bool use_full, const bool use_location); +bool BPy_errors_to_report_brief_with_prefix(struct ReportList *reports, const char *error_prefix); bool BPy_errors_to_report(struct ReportList *reports); /* TODO - find a better solution! */ |