7bb8862
Move error handling up. We need to check for the error here *before* we make a second request for the "last page". If we don't, we can end up submitting a query asking for "page 0" which fails without a helpful message.