github.com/franc20/ayesa_sap@v7.0.0-beta.28.0.20200124003224-302d4d52fa6c+incompatible/command/translatableerror/service_instance_not_shareable_error.go (about) 1 package translatableerror 2 3 // ServiceInstanceNotShareableError is returned when either the 4 // service_instance_sharing feature flag is disabled or the service broker has 5 // disabled sharing 6 type ServiceInstanceNotShareableError struct { 7 FeatureFlagEnabled bool 8 ServiceBrokerSharingEnabled bool 9 } 10 11 func (e ServiceInstanceNotShareableError) Error() string { 12 switch { 13 case !e.FeatureFlagEnabled && !e.ServiceBrokerSharingEnabled: 14 return `The "service_instance_sharing" feature flag is disabled for this Cloud Foundry platform. Also, service instance sharing is disabled for this service.` 15 case !e.FeatureFlagEnabled && e.ServiceBrokerSharingEnabled: 16 return `The "service_instance_sharing" feature flag is disabled for this Cloud Foundry platform.` 17 case e.FeatureFlagEnabled && !e.ServiceBrokerSharingEnabled: 18 return "Service instance sharing is disabled for this service." 19 } 20 return "Unexpected ServiceInstanceNotShareableError: service instance is shareable." 21 } 22 23 func (e ServiceInstanceNotShareableError) Translate(translate func(string, ...interface{}) string) string { 24 return translate(e.Error()) 25 }