How to collect validation errors and custom errors in pipe
I have a pipe in which I want to add errors to the arkerrors array. But when there is an validation error, then only the validation error is outputted.
When I have now the following type, only the validation error is shown:
But I want that both errors are returned, so that I can return all collected errors.
2 Replies
If type validation fails then the pipe doesn't run
You'd probably need to do something like
(untested)
I'm not sure returning errors is actually a "valid" thing though
Ok, I figured it out, thank you.
But it pretty much breaks down and makes it unusable for real world scenarios. You have to set standard values for each missing property and check when there is an ArkErrors the validity of each property and set them also to standard values if you need them in your business logic, which defeats the whole purpose of using ArkType from the beginning.