Skip to content
This repository has been archived by the owner. 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
sjsf added 3 commits Oct 27, 2017
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>
sjsf added 2 commits Oct 27, 2017
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

@ThomDietrich ThomDietrich Oct 27, 2017

Copy link
Contributor Author

@sjsf sjsf Oct 27, 2017

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

Copy link
Contributor

@ThomDietrich ThomDietrich Oct 27, 2017

Copy link
Contributor Author

@sjsf sjsf Oct 27, 2017

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

Copy link
Contributor

@ThomDietrich ThomDietrich Oct 27, 2017

sjsf added 2 commits Oct 27, 2017
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
2 checks passed
@kaikreuzer kaikreuzer added this to the 0.9.0 milestone Nov 8, 2017
@sjsf sjsf deleted the enhanceScriptErrors branch Nov 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants