sindresorhus / ow

Function argument validation for humans
https://sindresorhus.com/ow/
MIT License
3.81k stars 108 forks source link

Custom error message #122

Closed sarkistlt closed 4 years ago

sarkistlt commented 5 years ago

Issuehunt badges

Thanks for the library really useful and simple! I so requests to add functionality to pass custom error message, and it was closed with introducing labels. But be able to create custom error message is really important if you wan't to use this library for customer facing validations.

Is it somewhere in the plans or I should just use some other library like validation.js or joi?

Thanks!


IssueHunt Summary #### [gentilefulvio gentilefulvio](https://issuehunt.io/u/gentilefulvio) has been rewarded. ### Backers (Total: $60.00) - [issuehunt issuehunt](https://issuehunt.io/u/issuehunt) ($60.00) ### Submitted pull Requests - [#152 Add custom error messages](https://issuehunt.io/r/sindresorhus/ow/pull/152) - [#156 Add public method to Predicate class for customize validate message](https://issuehunt.io/r/sindresorhus/ow/pull/156) - [#177 Add the ability to provide custom messages](https://issuehunt.io/r/sindresorhus/ow/pull/177) --- ### Tips - Checkout the [Issuehunt explorer](https://issuehunt.io/r/sindresorhus/ow/) to discover more funded issues. - Need some help from other developers? [Add your repositories](https://issuehunt.io/r/new) on IssueHunt to raise funds.
sindresorhus commented 5 years ago

Yes, we should support this. Although for your use-case, Joi would probably be better choice. At least until we support this #92, and #58.

sarkistlt commented 5 years ago

thanks for quick reply, I'll wait)

IssueHuntBot commented 5 years ago

@issuehuntfest has funded $60.00 to this issue. See it on IssueHunt

whmountains commented 5 years ago

I would like to work on this. I am thinking that the message could be passed in as the last argument. @sindresorhus do you approve?

ansarizafar commented 5 years ago

Is there any progress on this issue?

sindresorhus commented 4 years ago

For anyone that wants to work on this, see the initial attempt and feedback in https://github.com/sindresorhus/ow/pull/156.

issuehunt-oss[bot] commented 4 years ago

@sindresorhus has rewarded $54.00 to @gentilefulvio. See it on IssueHunt