summaryrefslogtreecommitdiff
path: root/pyuno
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-10-12 22:02:15 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-10-14 15:37:17 +0200
commit176e8cf09a527438ec9b2b20ba2df23fa45226bc (patch)
tree76897d74143771a9ee9249c49bbe91da9ffa0433 /pyuno
parent328d6aae9e2b7a73f6672800629230f5b46d15b1 (diff)
Use exception ctors, instead of setting members later
Avoids overwriting source location in message Change-Id: Ia0290c7dd1ab3ea1357712a27ecab75c7b583dd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157893 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'pyuno')
-rw-r--r--pyuno/source/module/pyuno_runtime.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx
index 799752fefee3..68b1ea508293 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -943,8 +943,7 @@ Any Runtime::extractUnoException( const PyRef & excType, const PyRef &excValue,
{
buf.append( ", no traceback available\n" );
}
- RuntimeException e;
- e.Message = buf.makeStringAndClear();
+ RuntimeException e(buf.makeStringAndClear());
#if OSL_DEBUG_LEVEL > 0
fprintf( stderr, "Python exception: %s\n",
OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr() );