Bug 123144 - Unfriendly Error Message in VBASupport 1
Summary: Unfriendly Error Message in VBASupport 1
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.1 all versions
Hardware: All All
: medium enhancement
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.3.0
Keywords:
Depends on:
Blocks: Error-Messages
  Show dependency treegraph
 
Reported: 2019-02-03 16:28 UTC by himajin100000
Modified: 2021-09-20 05:57 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
document to be used for STR (9.04 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-02-03 16:29 UTC, himajin100000
Details

Note You need to log in before you can comment on or make changes to this bug.
Description himajin100000 2019-02-03 16:28:49 UTC
Description:
see steps to reproduce

Steps to Reproduce:
1. Open the attached ods file
2. Run the Main1() in Module1
3. Run the Main2() in Module2

Actual Results:
Error Message on step 2 is:
-----
BASIC runtime error.
Variable not defined.
----

Error Message on step 3 is:

-----
BASIC runtime error.
'12'
a
-----


Expected Results:
Error Message on step 3 should be:

-----
BASIC runtime error.
Variable not defined.
----


Reproducible: Always


User Profile Reset: No



Additional Info:
Advantage:
It's easier for StarBasic programmer to find out what the error is.

Drawback:
Programmer may not find out the name of variable that causes the error so easily.

Source Code Pointer:
https://opengrok.libreoffice.org/xref/core/basic/source/runtime/runtime.cxx?r=70519a43#3314

https://opengrok.libreoffice.org/xref/core/basic/source/runtime/runtime.cxx?r=70519a43#3450

rMsg.isEmpty() is false in the following code
https://opengrok.libreoffice.org/xref/core/basic/source/runtime/runtime.cxx?r=70519a43#940
Comment 1 himajin100000 2019-02-03 16:29:56 UTC
Created attachment 148873 [details]
document to be used for STR
Comment 2 himajin100000 2019-02-03 16:30:34 UTC
Version: 6.3.0.0.alpha0+ (x64)
Build ID: 573a473275ad7c76d0cada9b7e73d4923e7a79d5
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-02-03_01:22:10
Locale: ja-JP (ja_JP); UI-Language: en-US
Calc: threaded
Comment 3 Xisco Faulí 2019-03-14 17:34:45 UTC
Reproduced in

Version: 6.3.0.0.alpha0+
Build ID: c196d70337f6b755cfc4c34beda05554c6fab114
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

and

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 4 Andreas Heinisch 2021-09-15 17:13:15 UTC
As a workaround I would propose that we just append the message at the end. This would lead to something like:

Variable not defined: a
Comment 5 Commit Notification 2021-09-19 16:47:32 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/adb38e36e3944b47dbf278f882dd07cbabea5ced

tdf#123144 - Always translate an error number to a vba error message

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.