github.com/franc20/ayesa_sap@v7.0.0-beta.28.0.20200124003224-302d4d52fa6c+incompatible/actor/actionerror/route_not_found_error.go (about) 1 package actionerror 2 3 import "fmt" 4 5 // RouteNotFoundError is returned when a route cannot be found 6 type RouteNotFoundError struct { 7 Host string 8 DomainGUID string 9 DomainName string 10 Path string 11 Port int 12 } 13 14 func (e RouteNotFoundError) Error() string { 15 if e.DomainName != "" { 16 switch { 17 case e.Host != "" && e.Path != "": 18 return fmt.Sprintf("Route with host '%s', domain '%s', and path '%s' not found.", e.Host, e.DomainName, e.Path) 19 case e.Host != "": 20 return fmt.Sprintf("Route with host '%s' and domain '%s' not found.", e.Host, e.DomainName) 21 case e.Path != "": 22 return fmt.Sprintf("Route with domain '%s' and path '%s' not found.", e.DomainName, e.Path) 23 default: 24 return fmt.Sprintf("Route with domain '%s' not found.", e.DomainName) 25 } 26 } 27 if e.Path != "" { 28 return fmt.Sprintf("Route with host '%s', domain guid '%s', and path '%s' not found.", e.Host, e.DomainGUID, e.Path) 29 } 30 return fmt.Sprintf("Route with host '%s' and domain guid '%s' not found.", e.Host, e.DomainGUID) 31 }