Skip to content

Commit

Permalink
updated error handling again
Browse files Browse the repository at this point in the history
  • Loading branch information
idalindegaard committed Dec 16, 2024
1 parent 1df87af commit aa06f8e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cg_lims/EPPs/files/femtopulse_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,15 @@ def get_data_and_write(
"error": "Position is not possible for the run"})

if failed_samples:
error_message: str = "\n".join(
f"Sample {sample['artifact_name']} in position {sample['parsed_well']}: {sample['error']}"
for sample in failed_samples
)
raise InvalidValueError(f"Errors found:\n{error_message}")
error_index: int = 0
for sample in failed_samples:
error_message: str = f"Sample {sample['artifact_name']} in position {sample['parsed_well']}: {sample['error']}"
if error_index < 1:
all_errors: str = error_message
error_index =+ 1
else:
all_errors = all_errors + '\n' + error_message
raise InvalidValueError(f"Errors found:\n{all_errors}")

# The ladder will always be in well A12
SAMPLE_NAMES[-1] = "ladder"
Expand Down

0 comments on commit aa06f8e

Please sign in to comment.