Skip to content

Commit

Permalink
fix: better error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Feb 9, 2024
1 parent 404ae9d commit 1b21dd6
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,13 @@ def export_getPilotLoggingInfo(self, pilotReference):
result = self.pilotAgentsDB.getPilotInfo(pilotReference)
if not result["OK"]:
self.log.error("Failed to get info for pilot", result["Message"])
return S_ERROR("Failed to get info for pilot")
result
if not result["Value"]:
self.log.warn("The pilot info is empty", pilotReference)
return S_ERROR("Pilot info is empty")

pilotDict = result["Value"][pilotReference]
result = getPilotCE(pilotDict)
if not result["OK"]:
if not (result := getPilotCE(pilotDict))["OK"]:
return result

ce = result["Value"]
Expand All @@ -251,12 +250,10 @@ def export_getPilotLoggingInfo(self, pilotReference):
return S_ERROR(f"Pilot logging not available for {pilotDict['GridType']} CEs")

# Set proxy or token for the CE
result = setPilotCredentials(ce, pilotDict)
if not result["OK"]:
if not (result := setPilotCredentials(ce, pilotDict))["OK"]:
return result

result = getPilotRef(pilotReference, pilotDict)
if not result["OK"]:
if not (result := getPilotRef(pilotReference, pilotDict))["OK"]:
return result
pRef = result["Value"]

Expand Down

0 comments on commit 1b21dd6

Please sign in to comment.