Bug 146176 - [UI] Cryptic messages for average user on macro errors,
Summary: [UI] Cryptic messages for average user on macro errors,
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyMedium, easyHack, skillDesign, topicUI
Depends on:
Blocks: Macro-UI
  Show dependency treegraph
 
Reported: 2021-12-11 12:29 UTC by Olivier Hallot
Modified: 2022-05-26 13:42 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Cryptic messages scares end users (32.99 KB, image/png)
2021-12-11 12:29 UTC, Olivier Hallot
Details
file with missing macro, throw scripting error. (11.30 KB, application/vnd.oasis.opendocument.text)
2021-12-13 12:47 UTC, Olivier Hallot
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Hallot 2021-12-11 12:29:20 UTC
Created attachment 176864 [details]
Cryptic messages scares end users

Attached is a dialog that sparks uncountable demand for help in Brazilian public forums and may be in other languages too.

The message box has intermixed language and cryptic contents for the average end-user. It must be brought to translation in full in layman terms.

-----8<-----
    Ocorreu um erro de Scripting Framework durante a execução do script Basic vnd.sun.star.script:Standard.Module1.www?language=Basic&location=document.
    
    Mensagem: The following Basic script could not be found:
    library: 'Standard'
    module: 'Module1'
    method: 'www'
    location: 'document'
    /home/buildslave/source/libo-core/scripting/source/basprov/basprov.cxx:365
    
-----8<-----
        
Terms senseless to average end user, non-English speaker:
---------------------------------------------------------
"Scripting Framework"
"vnd.sun.star.script ...."
"script"
        
Untranslated strings:
---------------------
message content, e.g. 'The following Basic script could not be found:'
        
'library', 
'module', 
'method', 
'location', 
document
        
Affected string in cui/inc/strings.hrc
--------------------------------------
https://opengrok.libreoffice.org/xref/core/cui/inc/strings.hrc?r=335ffc0f#248
        
#define RID_CUISTR_ERROR_TITLE                      NC_("RID_SVXSTR_ERROR_TITLE", "%PRODUCTNAME Error")
#define RID_CUISTR_ERROR_LANG_NOT_SUPPORTED         NC_("RID_SVXSTR_ERROR_LANG_NOT_SUPPORTED", "The scripting language %LANGUAGENAME is not supported.")
#define RID_CUISTR_ERROR_RUNNING                    NC_("RID_SVXSTR_ERROR_RUNNING", "An error occurred while running the %LANGUAGENAME script %SCRIPTNAME.")
#define RID_CUISTR_EXCEPTION_RUNNING                NC_("RID_SVXSTR_EXCEPTION_RUNNING", "An exception occurred while running the %LANGUAGENAME script %SCRIPTNAME.")
#define RID_CUISTR_ERROR_AT_LINE                    NC_("RID_SVXSTR_ERROR_AT_LINE", "An error occurred while running the %LANGUAGENAME script %SCRIPTNAME at line: %LINENUMBER.")
#define RID_CUISTR_EXCEPTION_AT_LINE                NC_("RID_SVXSTR_EXCEPTION_AT_LINE", "An exception occurred while running the %LANGUAGENAME script %SCRIPTNAME at line: %LINENUMBER.")
#define RID_CUISTR_FRAMEWORK_ERROR_RUNNING          NC_("RID_SVXSTR_FRAMEWORK_ERROR_RUNNING", "A Scripting Framework error occurred while running the %LANGUAGENAME script %SCRIPTNAME.")
#define RID_CUISTR_ERROR_TYPE_LABEL                 NC_("RID_SVXSTR_ERROR_TYPE_LABEL", "Type:")
#define RID_CUISTR_ERROR_MESSAGE_LABEL              NC_("RID_SVXSTR_ERROR_MESSAGE_LABEL", "Message:")
        
Missing translatable strings (suggestion)
-----------------------------------------
#define RID_CUISTR_ERROR_LIBRARY_LABEL
#define RID_CUISTR_ERROR_MODULE_LABEL
#define RID_CUISTR_ERROR_METHOD_LABEL
#define RID_CUISTR_ERROR_LOCATION_LABEL
        
Affected strings in scripting/source/basprov/basprov.cxx#355
        if ( !xScript.is() )
        {
            throw provider::ScriptFrameworkErrorException(
                "The following Basic script could not be found:\n"
                "library: '" + aLibrary + "'\n"
                "module: '" + aModule + "'\n"
                "method: '" + aMethod + "'\n"
                "location: '" + aLocation + "'\n",
                Reference< XInterface >(),
                scriptURI, "Basic",
                provider::ScriptFrameworkErrorType::NO_SUCH_SCRIPT );
        }
Comment 1 Heiko Tietze 2021-12-13 12:33:23 UTC
Do you have an example script that throws this error?
Comment 2 Olivier Hallot 2021-12-13 12:47:59 UTC
Created attachment 176898 [details]
file with missing macro, throw scripting error.
Comment 3 Heiko Tietze 2021-12-13 13:15:25 UTC
How about "The macro Standard:Module1.macronotfound not found. Please check whether all files are placed at the right position" taking the concatenated text from what is shown at assigned actions. However this would hide method and location.
Comment 4 Rafael Lima 2021-12-13 13:57:16 UTC
I agree that this error message does not help casual programmers. Starting with "A Scripting Framework error" does not emphasize the real cause of the problem.

Following Heiko's idea, I would also include a few of the fields that are currently displayed in the error message:

-----------------------
The Basic macro Standard.Module1.macronotfound could not be found. The macro is expected to be located at:

Location: Document
Library: Standard
Module: Module 1
Macro name: macronotfound
-----------------------
Comment 5 Heiko Tietze 2021-12-16 14:38:34 UTC
No further input, let's follow Rafael's suggestion.
Comment 6 Rafael Lima 2022-02-17 15:18:20 UTC
Proposed patch at:
https://gerrit.libreoffice.org/c/core/+/130024
Comment 7 Rafael Lima 2022-05-26 13:31:25 UTC
(In reply to Rafael Lima from comment #6)
> Proposed patch at:
> https://gerrit.libreoffice.org/c/core/+/130024

Hi all. My proposed patch failed at some cases, returning wrong messages to the user. The problem is that passing a string from "scripting" to "cui" feels hacky and I don't feel confident with the proposed patch.

So I am unassigning it from myself for the moment.