mirror of https://github.com/status-im/consul.git
Update error texts (#11022)
Co-authored-by: Daniel Nephin <dnephin@hashicorp.com>
This commit is contained in:
parent
1f9479603c
commit
e18f3c1f6d
|
@ -787,7 +787,7 @@ func (b *builder) build() (rt RuntimeConfig, err error) {
|
|||
return RuntimeConfig{}, fmt.Errorf("config_entries.bootstrap[%d]: %s", i, err)
|
||||
}
|
||||
if err := entry.Validate(); err != nil {
|
||||
return RuntimeConfig{}, fmt.Errorf("config_entries.bootstrap[%d]: %s", i, err)
|
||||
return RuntimeConfig{}, fmt.Errorf("config_entries.bootstrap[%d]: %w", i, err)
|
||||
}
|
||||
configEntries = append(configEntries, entry)
|
||||
}
|
||||
|
|
|
@ -171,7 +171,7 @@ func (e *IngressGatewayConfigEntry) Validate() error {
|
|||
serviceNames := make(map[ServiceID]struct{})
|
||||
for i, s := range listener.Services {
|
||||
if err := validateInnerEnterpriseMeta(&s.EnterpriseMeta, &e.EnterpriseMeta); err != nil {
|
||||
return fmt.Errorf("Services[%d].%v", i, err)
|
||||
return fmt.Errorf("services[%d]: %w", i, err)
|
||||
}
|
||||
sn := NewServiceName(s.Name, &s.EnterpriseMeta)
|
||||
if err := s.RequestHeaders.Validate(listener.Protocol); err != nil {
|
||||
|
@ -401,7 +401,7 @@ func (e *TerminatingGatewayConfigEntry) Validate() error {
|
|||
cid := NewServiceID(svc.Name, &svc.EnterpriseMeta)
|
||||
|
||||
if err := validateInnerEnterpriseMeta(&svc.EnterpriseMeta, &e.EnterpriseMeta); err != nil {
|
||||
return fmt.Errorf("Service %q: %v", cid.String(), err)
|
||||
return fmt.Errorf("service %q: %w", cid, err)
|
||||
}
|
||||
|
||||
// Check for duplicates within the entry
|
||||
|
|
|
@ -14,6 +14,6 @@ func RequireErrorContains(t testing.TB, err error, expectedErrorMessage string)
|
|||
t.Fatal("An error is expected but got nil.")
|
||||
}
|
||||
if !strings.Contains(err.Error(), expectedErrorMessage) {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
t.Fatalf("expected err %v to contain %q", err, expectedErrorMessage)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue