Validator: break on first failed step to avoid further errors

This commit is contained in:
Alice Gaudon 2020-08-26 15:02:09 +02:00
parent 66ec3c0b47
commit 4ab615c457
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "wms-core", "name": "wms-core",
"version": "0.20.5-rc.3", "version": "0.20.5-rc.4",
"description": "Node web application framework and toolbelt.", "description": "Node web application framework and toolbelt.",
"repository": "https://gitlab.com/ArisuOngaku/wms-core", "repository": "https://gitlab.com/ArisuOngaku/wms-core",
"author": "Alice Gaudon <alice@gaudon.pro>", "author": "Alice Gaudon <alice@gaudon.pro>",

View File

@ -44,6 +44,7 @@ export default class Validator<T> {
error.thingName = thingName; error.thingName = thingName;
error.value = value; error.value = value;
bag.addMessage(error); bag.addMessage(error);
break;
} else if (step.interrupt !== undefined && step.interrupt(value)) { } else if (step.interrupt !== undefined && step.interrupt(value)) {
break; break;
} }