Skip to content
Snippets Groups Projects
Commit adfc6f00 authored by Karim Ahmed's avatar Karim Ahmed
Browse files

Merge branch 'fix/raise_warning_for_ccv_error_only' into 'master'

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

See merge request detectors/pycalibration!627
parents 6cf95a34 9922d65d
No related branches found
No related tags found
1 merge request!627FIX: Add "creating calibration_constant_version" to the check for the already taken ccv error
......@@ -703,7 +703,12 @@ def send_to_db(db_module: str, karabo_id: str, constant, condition,
raise
except Exception as e:
# 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(
f"WARNING: {constant.name} for {db_module}"
" has already been injected with the same "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment