page: move custom error handling to include