Return a more helpful message in case you are creating
a domain where it already exists. The client's behavior
can be tailored based on the returned message in this
case.
Issue-ID: AAF-573
Change-Id: I9fdebe8f136ba09e04576214b37a76213a4ad529
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
err = v.vaultClient.Sys().Mount(mountPath, mountInput)
if smslogger.CheckError(err, "Create Domain") != nil {
+ if strings.Contains(err.Error(), "existing mount") {
+ //It is already mounted
+ return SecretDomain{}, errors.New("existing domain")
+ }
return SecretDomain{}, errors.New("Unable to create Secret Domain")
}