added more message changes

This commit is contained in:
Ken Cochrane 2013-03-14 19:43:42 -07:00
parent f1cf5074f5
commit 9b94d89b06
1 changed files with 4 additions and 4 deletions

View File

@ -96,9 +96,9 @@ func Login(authConfig AuthConfig) (string, error) {
return "", err
}
defer req1.Body.Close()
reqBody, _ = ioutil.ReadAll(req1.Body)
reqStatusCode = req1.StatusCode
req1.Body.Close()
if reqStatusCode == 201 {
status = "Account Created\n"
@ -121,15 +121,15 @@ func Login(authConfig AuthConfig) (string, error) {
status = "Login Succeeded\n"
storeConfig = true
} else {
status = fmt.Sprintf("Login Error: %s\n", body)
status = fmt.Sprintf("Login: %s\n", body)
return "", errors.New(status)
}
} else {
status = fmt.Sprintf("Registration Error: %s\n", reqBody)
status = fmt.Sprintf("Registration: %s\n", string(reqBody))
return "", errors.New(status)
}
} else {
status = fmt.Sprintf("Error: %s : %s \n", reqStatusCode, reqBody)
status = fmt.Sprintf("[%s] : %s \n", reqStatusCode, string(reqBody))
return "", errors.New(status)
}
if storeConfig {