Skip to content

Commit

Permalink
[MINOR] Add error message log in case of incorrect paramserv functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Baunsgaard committed Dec 1, 2021
1 parent fbed9dc commit bb155bc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/org/apache/sysds/hops/rewrite/HopRewriteUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
package org.apache.sysds.hops.rewrite;

import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.sysds.api.DMLScript;
import org.apache.sysds.common.Types.DataType;
import org.apache.sysds.common.Types.ExecMode;
Expand Down Expand Up @@ -87,8 +89,8 @@
import java.util.LinkedHashMap;
import java.util.List;

public class HopRewriteUtils
{
public class HopRewriteUtils {
private static final Log LOG = LogFactory.getLog(HopRewriteUtils.class.getName());

public static boolean isValueTypeCast( OpOp1 op ) {
return op == OpOp1.CAST_AS_BOOLEAN
Expand Down Expand Up @@ -1637,7 +1639,10 @@ public static boolean knownParamservFunctions(Hop hop, DMLProgram prog) {
&& prog.getFunctionStatementBlock(sagg) != null;
}
catch(Exception ex) {
//robustness invalid function keys
// If the function keys are incorrect this exception is caught for robustness in error messages for users.
// Intensionally only catching the exception!
// For debugging if for some reason the error we encountered was something else we LOG the error.
LOG.error(ex);
return false;
}
}
Expand Down

0 comments on commit bb155bc

Please sign in to comment.