be more specific for error message (#1409)

### What problem does this PR solve?

#918 

### Type of change

- [x] Refactoring
This commit is contained in:
KevinHuSh
2024-07-08 09:32:44 +08:00
committed by GitHub
parent dcb3fb2073
commit b3ebc66b13
9 changed files with 126 additions and 61 deletions

View File

@ -44,8 +44,10 @@ class SwitchParam(ComponentParamBase):
self.default = ""
def check(self):
self.check_empty(self.conditions, "Switch conditions")
self.check_empty(self.default, "Default path")
self.check_empty(self.conditions, "[Switch] conditions")
self.check_empty(self.default, "[Switch] Default path")
for cond in self.conditions:
if not cond["to"]: raise ValueError(f"[Switch] 'To' can not be empty!")
def operators(self, field, op, value):
if op == "gt":