PHP error handling with exit

If you output all the error messages and then the footer as @Mittineague suggested then the exit after that will not cause problems as the page will be complete