DataCleaner icon indicating copy to clipboard operation
DataCleaner copied to clipboard

Make a "soft" validation error

Open LosD opened this issue 8 years ago • 0 comments

Currently, we only have "hard" validation failures, which essentially makes the job building stop, so that e.g. output datastreams does not exist yet. We'll need some way to make more "soft" validation errors which doesn't break the job building, but just disallows execution.

A way would be to allow @Validateannotated methods to have multiple signatures, one of them being the current voidas return type (for backwards compatibility), the other being one of;

  1. A simple boolean, truebeing validated successfully, false being a failed validation (soft).
  2. Some kind of a ValidationErrorclass, with a reason and a level, like ValidationError.WARNING, ValidationError.EXECUTION and ValidationError.HARD (or BUILD, since hard errors would stop the building, like all does now).
  3. Like 2, but with an array of ValidationError.

In all cases, throwing any exception is the same as a hard validation error.

I think that 1. might be too simplistic, so I'd prefer 2 or 3. That also makes it possible to show custom messages in the UI. 2. has the advantage of simplicity, 3. of flexibility and over time allowing the UI to show all problems from the beginning.

LosD avatar Nov 09 '16 10:11 LosD