When errors occur, now checking pageInfo.method instead of response.req since response.req may be undefined when errors occur