wizards/source/scriptforge/SF_Exception.xba | 8 ++++---- wizards/source/scriptforge/SF_Session.xba | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
New commits: commit fc36eed73e5033a34698c30801f159d533018b08 Author: Jean-Pierre Ledure <j...@ledure.be> AuthorDate: Wed Oct 16 14:45:37 2024 +0200 Commit: Jean-Pierre Ledure <j...@ledure.be> CommitDate: Wed Oct 16 17:47:14 2024 +0200 ScriptForge session.ExecuteCalcFunction error handling 1) Error handling in the ExecuteCalcFunction() function must be conditioned by the global error handling. True; display a user-friendly message False: abort on the erroneous line So far, an ambiguous error message was displayed in both cases. 2) Above ambiguous error message was corrupted by the detour to SF_Array.Prepend() method in exc.RaiseFatal() and exc.RaiseAbort(). A simple workaround fixes the ambiguity about the name of the faulty routine. Change-Id: Iab38b48e6291e1960fc288696a7ebd18ffe8ebae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175020 Reviewed-by: Jean-Pierre Ledure <j...@ledure.be> Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_Exception.xba b/wizards/source/scriptforge/SF_Exception.xba index 02259ffc329b..9e27c5202124 100644 --- a/wizards/source/scriptforge/SF_Exception.xba +++ b/wizards/source/scriptforge/SF_Exception.xba @@ -709,7 +709,7 @@ Const cstSubArgs = "[Source=Erl]" ' Save Err, Erl, .. values before any On Error ... statement SF_Exception._CaptureSystemError() On Local Error Resume Next - + Check: If IsMissing(Source) Or IsEmpty(Source) Then Source = "" @@ -720,7 +720,7 @@ Try: Set L10N = _SF_._GetLocalizedInterface() If Len(_SF_.MainFunction) > 0 Then ' MainFunction = [Library.]Module.Method vLocation = Split(_SF_.MainFunction, ".") - If UBound(vLocation) < 2 Then vLocation = SF_Array.Prepend(vLocation, "ScriptForge") + If UBound(vLocation) < 2 Then vLocation = Split("ScriptForge." & _SF_.MainFunction, ".") sLocation = L10N.GetText("VALIDATESOURCE", vLocation(0), vLocation(1), vLocation(2)) & " " Else sLocation = "" @@ -779,7 +779,7 @@ Const cstStop = "⏻" ' Chr(9211) ' Save Err, Erl, .. values before any On Error ... statement SF_Exception._CaptureSystemError() If SF_Utils._ErrorHandling() Then On Local Error GoTo Catch - + Check: If IsMissing(ErrorCode) Or IsEmpty(ErrorCode) Then ErrorCode = "" If SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then @@ -791,7 +791,7 @@ Try: ' Location header common to all error messages If Len(_SF_.MainFunction) > 0 Then ' MainFunction = [Library.]Module.Method vLocation = Split(_SF_.MainFunction, ".") - If UBound(vLocation) < 2 Then vLocation = SF_Array.Prepend(vLocation, "ScriptForge") + If UBound(vLocation) < 2 Then vLocation = Split("ScriptForge." & _SF_.MainFunction, ".") sService = vLocation(1) sMethod = vLocation(2) sLocation = L10N.GetText("VALIDATESOURCE", vLocation(0), sService, sMethod) _ diff --git a/wizards/source/scriptforge/SF_Session.xba b/wizards/source/scriptforge/SF_Session.xba index 1eb34916a0e3..ebde30256c7f 100644 --- a/wizards/source/scriptforge/SF_Session.xba +++ b/wizards/source/scriptforge/SF_Session.xba @@ -223,7 +223,7 @@ Try: If UBound(pvArgs) = 0 Then If IsEmpty(pvArgs(0)) Then pvArgs = Array() End If - On Local Error GoTo CatchCall + If SF_Utils._ErrorHandling() Then On Local Error GoTo CatchCall vReturn = oCalc.callFunction(UCase(CalcFunction), pvArgs()) Finally: