if err != nil {
switch err.(type) {
// NotFound means cluster metadata was never persisted and custom search attributes are not defined.
// Ignore the error.
saCache.expireOn = now.Add(cacheRefreshInterval)
err = nil
case *serviceerror.Unavailable:
if saCache.dbVersion == 0 {