Skip to content

Commit

Permalink
Merge pull request #428 from PanDAWMS/095-code-improvement
Browse files Browse the repository at this point in the history
DF/data4es(-nested)/095: improve try/except logic.
  • Loading branch information
mgolosova committed Oct 22, 2020
2 parents 6207fa8 + 0a9afbd commit 9fb267e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,11 @@ def process(stage, message):
except Exception:
stage.output_error("Failed to process dataset '%s'"
% ds['name'], sys.exc_info())
# Do not put this into try/except above:
# any exception produced by it indicates a problem
# with the stage code that demands a full stop.
change_key_names(ds)
else:
# Do not put this into try/except above:
# any exception produced by it indicates a problem
# with the stage code that demands a full stop.
change_key_names(ds)
stage.output(pyDKB.dataflow.communication.messages.JSONMessage(data))

return True
Expand Down
8 changes: 5 additions & 3 deletions Utils/Dataflow/data4es/095_datasetInfoAMI/amiDatasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,11 @@ def process(stage, message):
except Exception:
stage.output_error("Failed to process dataset '%s'"
% data['datasetname'], sys.exc_info())
# Do not put this into try/except above - any exception produced by it
# indicates a problem with the stage code that demands a full stop.
change_key_names(data)
else:
# Do not put this into try/except above - any exception produced
# by it indicates a problem with the stage code that demands
# a full stop.
change_key_names(data)
stage.output(pyDKB.dataflow.communication.messages.JSONMessage(data))

return True
Expand Down

0 comments on commit 9fb267e

Please sign in to comment.