Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Enhance rule interpretation errors #4462

Merged
merged 7 commits into from Nov 1, 2017

Conversation

sjsf
Copy link
Contributor

@sjsf sjsf commented Oct 27, 2017

see #4317.

This improves the logged error messages as following:

Class cast exception:

Rule 'myRuleTest': java.lang.Number

becomes

Could not cast NULL to java.lang.Number; line 6, column 35, length 26

Unknown member:

The name '<XCastedExpressionImpl>.blaaa' cannot be resolved to an item or type.

becomes

'blaaa' is not a member of 'org.eclipse.smarthome.core.types.UnDefType'; line 6, column 34, length 24

Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
throw new RuntimeException(
"The name '" + featureCall.toString() + "' cannot be resolved to an item or type.");
if (featureCall instanceof XMemberFeatureCall) {
throw new ScriptExecutionException(new ScriptError(
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

argh, good spot! No idea why there were tabs, but that's history now 😉

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Awesome, thanks for the hint! I started wondering already how you spotted them...

Copy link
Contributor

Choose a reason for hiding this comment

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

Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
@kaikreuzer kaikreuzer merged commit ebd2a3a into eclipse-archived:master Nov 1, 2017
@kaikreuzer kaikreuzer added this to the 0.9.0 milestone Nov 8, 2017
@sjsf sjsf deleted the enhanceScriptErrors branch November 14, 2017 16:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants