Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance rule interpretation errors #4462

Merged
merged 7 commits into from Nov 1, 2017

Conversation

Projects
None yet
3 participants
@sjka
Copy link
Contributor

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

sjka added some commits Oct 27, 2017

enhanced error message for ClassCastExceptions
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
enhanced error message for unknown methods
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
fix logging arguments in model rule engine
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>

sjka added some commits Oct 27, 2017

include position in custom errors
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
quote rule name in error logging
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(

This comment has been minimized.

Copy link
@ThomDietrich

This comment has been minimized.

Copy link
@sjka

sjka Oct 27, 2017

Author Contributor

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

This comment has been minimized.

This comment has been minimized.

Copy link
@sjka

sjka Oct 27, 2017

Author Contributor

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

This comment has been minimized.

sjka added some commits Oct 27, 2017

replaced tabs with spaces in ScriptInterpreter
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
removed trailing dots
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>

@kaikreuzer kaikreuzer added the DSLRules label Nov 1, 2017

@kaikreuzer kaikreuzer merged commit ebd2a3a into eclipse:master Nov 1, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
ip-validation
Details

@kaikreuzer kaikreuzer added this to the 0.9.0 milestone Nov 8, 2017

@sjka sjka deleted the sjka:enhanceScriptErrors branch Nov 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.