Better error handling for PageGenerator