forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
service_instance_not_shareable_error.go
25 lines (22 loc) · 1.1 KB
/
service_instance_not_shareable_error.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package translatableerror
// ServiceInstanceNotShareableError is returned when either the
// service_instance_sharing feature flag is disabled or the service broker has
// disabled sharing
type ServiceInstanceNotShareableError struct {
FeatureFlagEnabled bool
ServiceBrokerSharingEnabled bool
}
func (e ServiceInstanceNotShareableError) Error() string {
switch {
case !e.FeatureFlagEnabled && !e.ServiceBrokerSharingEnabled:
return `The "service_instance_sharing" feature flag is disabled for this Cloud Foundry platform. Also, service instance sharing is disabled for this service.`
case !e.FeatureFlagEnabled && e.ServiceBrokerSharingEnabled:
return `The "service_instance_sharing" feature flag is disabled for this Cloud Foundry platform.`
case e.FeatureFlagEnabled && !e.ServiceBrokerSharingEnabled:
return "Service instance sharing is disabled for this service."
}
return "Unexpected ServiceInstanceNotShareableError: service instance is shareable."
}
func (e ServiceInstanceNotShareableError) Translate(translate func(string, ...interface{}) string) string {
return translate(e.Error())
}