fix(testing): return organization name in failure messages
parent
6ebea1bc23
commit
7840e5e6b4
|
@ -105,10 +105,15 @@ func (s *Service) FindOrganization(ctx context.Context, filter platform.Organiza
|
|||
}
|
||||
}
|
||||
if n < 1 {
|
||||
msg := errOrganizationNotFound
|
||||
if filter.Name != nil {
|
||||
msg = fmt.Sprintf("organization name \"%s\" not found", *filter.Name)
|
||||
}
|
||||
|
||||
return nil, &platform.Error{
|
||||
Code: platform.ENotFound,
|
||||
Op: op,
|
||||
Msg: errOrganizationNotFound,
|
||||
Msg: msg,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,10 +151,15 @@ func (s *Service) FindOrganizations(ctx context.Context, filter platform.Organiz
|
|||
}
|
||||
|
||||
if len(orgs) == 0 {
|
||||
msg := errOrganizationNotFound
|
||||
if filter.Name != nil {
|
||||
msg = fmt.Sprintf("organization name \"%s\" not found", *filter.Name)
|
||||
}
|
||||
|
||||
return orgs, 0, &platform.Error{
|
||||
Code: platform.ENotFound,
|
||||
Op: op,
|
||||
Msg: errOrganizationNotFound,
|
||||
Msg: msg,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -367,7 +367,7 @@ func CreateBucket(
|
|||
buckets: []*platform.Bucket{},
|
||||
err: &platform.Error{
|
||||
Code: platform.ENotFound,
|
||||
Msg: "organization not found",
|
||||
Msg: "organization name \"org1\" not found",
|
||||
Op: platform.OpCreateBucket,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -465,7 +465,7 @@ func FindOrganizations(
|
|||
err: &platform.Error{
|
||||
Code: platform.ENotFound,
|
||||
Op: platform.OpFindOrganizations,
|
||||
Msg: "organization not found",
|
||||
Msg: "organization name \"na\" not found",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -652,7 +652,7 @@ func FindOrganization(
|
|||
err: &platform.Error{
|
||||
Code: platform.ENotFound,
|
||||
Op: platform.OpFindOrganization,
|
||||
Msg: "organization not found",
|
||||
Msg: "organization name \"abc\" not found",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue