Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
exception handling before plate construction
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Bigelmayr committed Mar 23, 2023
1 parent d76ca9f commit bd48333
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/FluidXPlate/FluidXScanner.php
Expand Up @@ -85,17 +85,17 @@ public static function parseRawContent(string $rawContent): FluidXPlate
throw new ScanFluidXPlateException('Der Scanner lieferte keinen Plattenbarcode zurück.');
}

$plate = new FluidXPlate($id);
foreach ($barcodes as $coordinate => $barcode) {
$plate->addWell(Coordinate::fromString($coordinate, new CoordinateSystem96Well()), $barcode);
}

if (FluidXScanner::NO_READ === $id) {
throw new ScanFluidXPlateException([] === $barcodes
? 'Weder Platten-Barcode noch Tube-Barcodes konnten gescannt werden. Bitte überprüfen Sie, dass die Platte korrekt in den FluidX-Scanner eingelegt wurde.'
: 'Platten-Barcode konnte nicht gescannt werden. Bitte überprüfen Sie, dass die Platte mit der korrekten Orientierung in den FluidX-Scanner eingelegt wurde.');
}

$plate = new FluidXPlate($id);
foreach ($barcodes as $coordinate => $barcode) {
$plate->addWell(Coordinate::fromString($coordinate, new CoordinateSystem96Well()), $barcode);
}

return $plate;
}

Expand Down

0 comments on commit bd48333

Please sign in to comment.