I'm writing a user input library to easily manage the dynamic creation of forms for asking users for data.
I wanted to make the end developer have to 'think' about the bare minimum, so I went with having them throw exceptions instead of returning 'true' or 'false' and remembering to handle the return value etc.
In reality, it's worked out really well. Throwing exceptions has also given me a side benefit of being able to automatically record user errors in a log, all for 'free' as the creation of the exception causes the logging to be done.
Having said all of that, I was wondering if this is really 'against best practices'? Should I have kept exceptions only for times when I didn't even expect user input error, or is it OK to say "the data from the user has a problem... that's an exception"?
Any thoughts?