DEV Community

Discussion on: How do you handle improper function arguments?

Collapse
 
haidv profile image
HaiDV

There should be a validate function to validate your initial input and if the input is invalid, the system should throw a meaningful error for end-user, like BadRequestError. That's my idea