Skip to content
Snippets Groups Projects

FIX: Add "creating calibration_constant_version" to the check for the already taken ccv error

Merged Karim Ahmed requested to merge fix/raise_warning_for_ccv_error_only into master
All threads resolved!
1 file
+ 6
1
Compare changes
  • Side-by-side
  • Inline
+ 6
1
@@ -703,7 +703,12 @@ def send_to_db(db_module: str, karabo_id: str, constant, condition,
@@ -703,7 +703,12 @@ def send_to_db(db_module: str, karabo_id: str, constant, condition,
raise
raise
except Exception as e:
except Exception as e:
# TODO: refactor to use custom exception class
# TODO: refactor to use custom exception class
if "has already been taken" in str(e):
# Refactor error message for re-injecting an
 
# identical CCV to the database.
 
if all(s in str(e) for s in [
 
"Error creating calibration_constant_version",
 
"has already been taken",
 
]):
print(
print(
f"WARNING: {constant.name} for {db_module}"
f"WARNING: {constant.name} for {db_module}"
" has already been injected with the same "
" has already been injected with the same "
Loading