github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/actor/actionerror/domain_not_found_error.go (about) 1 package actionerror 2 3 import "fmt" 4 5 // DomainNotFoundError is an error wrapper that represents the case 6 // when the domain is not found. 7 type DomainNotFoundError struct { 8 Name string 9 GUID string 10 } 11 12 // Error method to display the error message. 13 func (e DomainNotFoundError) Error() string { 14 switch { 15 case e.Name != "": 16 return fmt.Sprintf("Domain %s not found", e.Name) 17 case e.GUID != "": 18 return fmt.Sprintf("Domain with GUID %s not found", e.GUID) 19 default: 20 return "Domain not found" 21 } 22 }