Skip to content

Commit 7cb6bcc

Browse files
committed
improve error messaging
1 parent fb1372a commit 7cb6bcc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/src/opentrons/protocol_api/labware.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,13 +1155,13 @@ def load_liquid(
11551155
if isinstance(well, str):
11561156
if well not in self:
11571157
raise KeyError(
1158-
"The elements of wells should name wells in this labware."
1158+
f"{well} is not a well in labware {self.name}. The elements of wells should name wells in this labware."
11591159
)
11601160
well_names.append(well)
11611161
elif isinstance(well, Well):
11621162
if well.parent is not self:
11631163
raise KeyError(
1164-
"The elements of wells should be wells of this labware."
1164+
f"{well.well_name} is not a well in labware {self.name}. The elements of wells should be wells of this labware."
11651165
)
11661166
well_names.append(well.well_name)
11671167
else:
@@ -1200,13 +1200,13 @@ def load_liquid_by_well(
12001200
if isinstance(well, str):
12011201
if well not in self:
12021202
raise KeyError(
1203-
"The keys of volumes should name wells in this labware"
1203+
f"{well} is not a well in {self.name}. The keys of volumes should name wells in this labware"
12041204
)
12051205
verified_volumes[well] = volume
12061206
elif isinstance(well, Well):
12071207
if well.parent is not self:
12081208
raise KeyError(
1209-
"The keys of volumes should be wells of this labware"
1209+
f"{well.well_name} is not a well in {self.name}. The keys of volumes should be wells of this labware"
12101210
)
12111211
verified_volumes[well.well_name] = volume
12121212
else:

0 commit comments

Comments
 (0)