Skip to content

Commit 04f293f

Browse files
committed
fix: Reverse the error conditions to avoid masking of the second error.
1 parent a88c4d9 commit 04f293f

File tree

1 file changed

+3
-2
lines changed
  • packages/toolbox-core/src/toolbox_core

1 file changed

+3
-2
lines changed

packages/toolbox-core/src/toolbox_core/tool.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,13 +288,14 @@ def bind_parameters(
288288
"""
289289
param_names = set(p.name for p in self.__params)
290290
for name in bound_params.keys():
291-
if name not in param_names:
292-
raise Exception(f"unable to bind parameters: no parameter named {name}")
293291
if name in self.__bound_parameters:
294292
raise ValueError(
295293
f"cannot re-bind parameter: parameter '{name}' is already bound"
296294
)
297295

296+
if name not in param_names:
297+
raise Exception(f"unable to bind parameters: no parameter named {name}")
298+
298299
new_params = []
299300
for p in self.__params:
300301
if p.name not in bound_params:

0 commit comments

Comments
 (0)