You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemds.apache.org by ba...@apache.org on 2021/12/01 10:39:48 UTC

[systemds] branch main updated: [MINOR] Add error message log in case of incorrect paramserv functions

This is an automated email from the ASF dual-hosted git repository.

baunsgaard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git


The following commit(s) were added to refs/heads/main by this push:
     new bb155bc  [MINOR] Add error message log in case of incorrect paramserv functions
bb155bc is described below

commit bb155bc385110d50b46b74ef149e44d3e0d70b59
Author: baunsgaard <ba...@tugraz.at>
AuthorDate: Wed Dec 1 11:38:30 2021 +0100

    [MINOR] Add error message log in case of incorrect paramserv functions
---
 .../java/org/apache/sysds/hops/rewrite/HopRewriteUtils.java   | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sysds/hops/rewrite/HopRewriteUtils.java b/src/main/java/org/apache/sysds/hops/rewrite/HopRewriteUtils.java
index c91671f..3cecceb 100644
--- a/src/main/java/org/apache/sysds/hops/rewrite/HopRewriteUtils.java
+++ b/src/main/java/org/apache/sysds/hops/rewrite/HopRewriteUtils.java
@@ -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;
@@ -87,8 +89,8 @@ import java.util.HashSet;
 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
@@ -1637,7 +1639,10 @@ public class HopRewriteUtils
 				&& 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;
 		}
 	}