Yeah, my functions general return false if they fail or if a function they call fails. Then, when it gets back up to application scope, I call a function which removes all the stuff in the output buffer (see ob_start, ob_flush etc to understand this), outputs the error page with the title and message included and exits the application. I could call this function from anywhere, but I find it more manageable if it is only called from the application scope so it doesn't produce anything I don't expect.