buildErrorMessage will build appropriate http error message based on the invalidConfig
(dbName string, invalidConfig *invalidConfigInfo)
| 382 | |
| 383 | // buildErrorMessage will build appropriate http error message based on the invalidConfig |
| 384 | func (sc *ServerContext) buildErrorMessage(dbName string, invalidConfig *invalidConfigInfo) *base.HTTPError { |
| 385 | if invalidConfig.databaseError != nil { |
| 386 | err := base.HTTPErrorf(http.StatusNotFound, "Database %s has an invalid configuration: %v. You must update database config immediately through create db process", dbName, invalidConfig.databaseError.ErrMsg) |
| 387 | return err |
| 388 | } |
| 389 | if invalidConfig.collectionConflicts { |
| 390 | err := base.HTTPErrorf(http.StatusNotFound, "Database %s has conflicting collections. You must update database config immediately through create db process", dbName) |
| 391 | return err |
| 392 | } |
| 393 | return base.HTTPErrorf(http.StatusNotFound, "Mismatch in database config for database %s bucket name: %s and backend bucket: %s groupID: %s You must update database config immediately", base.MD(dbName), base.MD(invalidConfig.configBucketName), base.MD(invalidConfig.persistedBucketName), base.MD(sc.Config.Bootstrap.ConfigGroupID)) |
| 394 | } |
| 395 | |
| 396 | func (sc *ServerContext) GetDbConfig(name string) *DbConfig { |
| 397 | if dbConfig := sc.GetDatabaseConfig(name); dbConfig != nil { |
no test coverage detected