I would rather check for 401 and 403s instead of a specific error message as it might change.