From 19b5c6097e4da4ff9344273acd87a74bbbcc55a9 Mon Sep 17 00:00:00 2001 From: merret Date: Mon, 21 Aug 2017 20:19:31 +0200 Subject: [PATCH 1/2] Log error for easier debugging. --- rulebase/pid-service.re | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rulebase/pid-service.re b/rulebase/pid-service.re index e8123c3..ce319d5 100644 --- a/rulebase/pid-service.re +++ b/rulebase/pid-service.re @@ -264,6 +264,10 @@ EUDATUpdatePIDWithNewChild(*parentPID, *childPID) { #------------------------------------------------------------------------------- EUDATGeteValPid(*pid, *key) { logInfo("[EUDATGeteValPid] get *key from *pid"); + if (*pid == "") { + logError("[EUDATGeteValPid] No PID provided. This will fail."); + # TODO throw error here to avoid costly interaction with pid server that will fail anyway. + } getEpicApiParameters(*credStoreType, *credStorePath, *epicApi, *serverID, *epicDebug); msiExecCmd("epicclient.py", "*credStoreType *credStorePath read *pid --key *key", "null", "null", "null", *outGRP); From 07d7c2083228cd750c461771a6a098257fa6eb71 Mon Sep 17 00:00:00 2001 From: merret Date: Mon, 21 Aug 2017 20:24:48 +0200 Subject: [PATCH 2/2] Fail the method 'EUDATGeteValPid' in case no pid is given (avoid costly interaction with PID server). --- rulebase/pid-service.re | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rulebase/pid-service.re b/rulebase/pid-service.re index ce319d5..453c8af 100644 --- a/rulebase/pid-service.re +++ b/rulebase/pid-service.re @@ -265,8 +265,10 @@ EUDATUpdatePIDWithNewChild(*parentPID, *childPID) { EUDATGeteValPid(*pid, *key) { logInfo("[EUDATGeteValPid] get *key from *pid"); if (*pid == "") { + # throw error to avoid costly interaction with pid server that will fail anyway logError("[EUDATGeteValPid] No PID provided. This will fail."); - # TODO throw error here to avoid costly interaction with pid server that will fail anyway. + *errorMsg = "Trying to read values from PID when no PID provided."; + failmsg(-1, *errorMsg); # TODO Return a more suitable return code } getEpicApiParameters(*credStoreType, *credStorePath, *epicApi, *serverID, *epicDebug); msiExecCmd("epicclient.py", "*credStoreType *credStorePath read *pid --key *key",