Error handling
Moderator: General Moderators
Error handling
I'm designing a PHP site from scratch and I want to know the best way to handle errors. I put together a function that becomes PHP's new go-to error-handling function but I've run across the idea...what if that function hiccups? How can I print a friendly error message if my error-handling function hiccups?
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Error handling
I'd go with exceptions, check what can cause the functions to fail and throw an exception based on that.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering