@@ -134,25 +134,21 @@ public Object getVariable(String variableName) {
134
134
checkArgument (
135
135
!StringUtils .isNullOrWhitespaceOnly (variableName ),
136
136
"sql variable name or jexl key cannot be null or empty." );
137
- try {
138
- if (variables .containsKey (variableName )) {
139
- return variables .get (variableName );
140
- }
141
- // load expression variable class
142
- if (parseAndMatchExpressionVariable (variableName )) {
143
- return ENGINE .eval (variableName , EngineContextHolder .getEngineContext (), null );
144
- }
145
- return null ;
146
- } catch (Exception e ) {
147
- String error = format (
148
- "The variable name or jexl key of sql \" ${%s}\" does not exist.\n "
149
- + "Please follow the following methods to resolve the problem:\n "
150
- + "1. global variables are enabled ? \n "
151
- + "2. variable is exists ? it`s defined in sql ? or global variable is defined ? \n "
152
- + "3. If it is a custom function variable, please check whether the class is loaded correctly" ,
153
- variableName );
154
- throw new BusException (error );
137
+ if (variables .containsKey (variableName )) {
138
+ return variables .get (variableName );
139
+ }
140
+ // load expression variable class
141
+ if (parseAndMatchExpressionVariable (variableName )) {
142
+ return ENGINE .eval (variableName , EngineContextHolder .getEngineContext (), null );
155
143
}
144
+ String error = format (
145
+ "The variable name or jexl key of sql \" ${%s}\" does not exist.\n "
146
+ + "Please follow the following methods to resolve the problem:\n "
147
+ + "1. global variables are enabled ? \n "
148
+ + "2. variable is exists ? it`s defined in sql ? or global variable is defined ? \n "
149
+ + "3. If it is a custom function variable, please check whether the class is loaded correctly" ,
150
+ variableName );
151
+ throw new BusException (error );
156
152
}
157
153
158
154
public boolean parseAndMatchExpressionVariable (String variableName ) {
0 commit comments