Open taylorjdawson opened 3 years ago
Any suggestions on how to best resolve this?
What about the option to call ow
without a type?
ow(5, ow.is(x => greaterThan(10, x)));
// => ArgumentError: Expected `5` to be greater than `10`
ow(5, 'custom label', ow.is(x => greaterThan(10, x)));
// => ArgumentError: (custom label) Expected `5` to be greater than `10`
Currently when a predicate is failed by returning a message the type is pre-pended to the message like so:
and if a custom label is added:
I would love the option to override/remove as I want to send this error message back to the client and having the type there would be context leak e.g. the client has no need to know backend type implementations.