Skip to content

Conversation

dalgwen
Copy link
Contributor

@dalgwen dalgwen commented Sep 15, 2025

Adding log details when having an error in a a script transformation in UI (sitemap).

Before this PR, when using a script transformation in a sitemap, the message doesn't show any hint about the root script issue.
We only have "Failed to execute script".
On the other hand, for the same script and error, in a transformation profile, the message is fully detailed.

This PR use the script cause as log message, if available.
The behaviour is modeled after "ScriptProfile.java" (executeScript method) as a reference.

First seen in a discussion about a community jsr223 bundle here

Use ScripProfile.java (executeScript) method as a reference.

Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
@dalgwen dalgwen requested a review from a team as a code owner September 15, 2025 09:10
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/java223-scripting-script-with-java-on-openhab-5-0-1-0-6-0-0-0/159853/22

Copy link
Member

@holgerfriedrich holgerfriedrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@holgerfriedrich holgerfriedrich merged commit e993cd8 into openhab:main Sep 16, 2025
4 checks passed
@holgerfriedrich holgerfriedrich added the enhancement An enhancement or new feature of the Core label Sep 16, 2025
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/java223-scripting-script-with-java-on-openhab-5-0-1-0-6-0-0-0/159853/23

holgerfriedrich pushed a commit that referenced this pull request Oct 16, 2025
#5028)

Use ScripProfile.java (executeScript) method as a reference.

Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
@holgerfriedrich holgerfriedrich added this to the 5.1 milestone Oct 16, 2025
@holgerfriedrich holgerfriedrich added the backported A PR that has been cherry-picked to a patch release branch label Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backported A PR that has been cherry-picked to a patch release branch enhancement An enhancement or new feature of the Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants