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

Fix error message for unknown function #2808

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public FunctionExpressionBuilder resolveFunctionBuilder(String functionName, Set
case 0:
{
// Since we have tried to find basic function initially, this means the function builder is not found, we report error
String message = "Can't resolve the builder for function '" + functionName + "' - stack:" + processingContext.getStack();
String message = "Can't resolve function '" + functionName + "' - stack:" + processingContext.getStack();
LOGGER.error(new LogInfo(Identity.getAnonymousIdentity().getName(), LoggingEventType.GRAPH_MISSING_FUNCTION, message).toString());
throw new EngineException(message, sourceInformation, EngineErrorType.COMPILATION);
}
Expand All @@ -443,7 +443,7 @@ public FunctionExpressionBuilder resolveFunctionBuilder(String functionName, Set
}
default:
{
throw new EngineException(results.keysView().makeString("Can't resolve the builder for function '" + functionName + "' - multiple matches found [", ", ", "]"), sourceInformation, EngineErrorType.COMPILATION);
throw new EngineException(results.keysView().makeString("Can't resolve function '" + functionName + "' - multiple matches found [", ", ", "]"), sourceInformation, EngineErrorType.COMPILATION);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ public void testAggregationAwareMappingErrorInAggregateViewModelOperationAggrega
" }\n" +
" }\n" +
")\n"));
Assert.assertEquals("Can't resolve the builder for function 'summation' - stack:[Lambda, new lambda, Applying summation]", e.getMessage());
Assert.assertEquals("Can't resolve function 'summation' - stack:[Lambda, new lambda, Applying summation]", e.getMessage());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,7 @@ public void testPropertyPostFunction()
public void testUnknownFunction()
{
test("Class test::Person[$this.lastName->ranDoMFuncTion()]{lastName:String[1];}",
"COMPILATION error at [1:36-49]: Can't resolve the builder for function 'ranDoMFuncTion' - stack:[Class 'test::Person' Fourth Pass, Constraint 0, new lambda, Applying ranDoMFuncTion]");
"COMPILATION error at [1:36-49]: Can't resolve function 'ranDoMFuncTion' - stack:[Class 'test::Person' Fourth Pass, Constraint 0, new lambda, Applying ranDoMFuncTion]");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
},
{
"ExceptionName": "EngineException",
"MessageRegex": "Can't resolve the builder for function|Can't find service",
"MessageRegex": "Can't resolve function|Can't find service",
"Priority": "primary"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public void testServiceExceptionCategorizationToUnknownErrorByAnyMatching()
@Test
public void testServiceExceptionCategorizationMatchingMethodPrioritizationOfExceptionOutlineToKeywords()
{
MetricsHandler.observeError(LoggingEventType.DSB_EXECUTE_ERROR, new EngineException("Can't resolve the builder for function 'get/Login/Kerberos"), TEST_SERVICE_PATH);
MetricsHandler.observeError(LoggingEventType.DSB_EXECUTE_ERROR, new EngineException("Can't resolve function 'get/Login/Kerberos"), TEST_SERVICE_PATH);
String[] labels = {"EngineException", "ServerExecutionError", "DsbExecute", TEST_SERVICE_PATH};
assertEquals(METRIC_REGISTRY.getSampleValue(METRIC_NAME, COUNTER_LABEL_NAMES, labels), 1, DELTA);
}
Expand Down