Beware Of Error Messages

Sometimes you unintentionally reveal more data than required in your error messages and you have to be careful about it as it can lead to some serious damage. If there's an error you don't have to present it in a detailed way or provide full exception details...as this could make SQL injection more easier for the attackers.

To prevent this situation - provide only minimal errors to your users, keep detailed errors in your server logs, and show users only the information they need.
This is one of the way to protect your website from hacking.