Eli points out that this is what report_fatal_error() is for.