Skip to content

Commit

Permalink
Merge pull request #467 from PanDAWMS/config_json
Browse files Browse the repository at this point in the history
Exception handling for JSON decoding errors
  • Loading branch information
fbarreir authored Dec 9, 2024
2 parents ed6dcc1 + b90d91c commit 343c4a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pandaserver/taskbuffer/OraDBProxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import traceback
import uuid
import warnings
from json.decoder import JSONDecodeError

from pandacommon.pandalogger.LogWrapper import LogWrapper
from pandacommon.pandalogger.PandaLogger import PandaLogger
Expand Down Expand Up @@ -457,9 +458,11 @@ def getConfigValue(self, component, key, app="pandaserver", vo=None):
return json.loads(value_json_str)
else:
raise ValueError
except JSONDecodeError:
_logger.debug(f"Could not decode. Value_json: {value_json_str}, Type: {type}")
return None
except ValueError:
error_message = f"Wrong value/type pair. Value: {value_str}, Type: {type}"
_logger.debug(error_message)
_logger.debug(f"Wrong value/type pair. Value: {value_str}, Type: {type}")
return None

# insert job to jobsDefined
Expand Down

0 comments on commit 343c4a6

Please sign in to comment.