github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/actor/actionerror/user_not_found.go (about) 1 package actionerror 2 3 import ( 4 "fmt" 5 6 "code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/constant" 7 ) 8 9 // UserNotFoundError is an error wrapper that represents the case 10 // when the user is not found in UAA. 11 type UserNotFoundError struct { 12 Username string 13 Origin string 14 } 15 16 // Error method to display the error message. 17 func (e UserNotFoundError) Error() string { 18 if e.Origin != "" && e.Origin != constant.DefaultOriginUaa { 19 return fmt.Sprintf("User '%s' with origin '%s' does not exist.", e.Username, e.Origin) 20 } 21 22 return fmt.Sprintf("User '%s' does not exist.", e.Username) 23 }