Changeset 15afcda19cb4…
Parent 67064c1e930b…
by Benjamin Pollack <benjamin@fogcreek.com>
Changes to one file · Browse files at 15afcda19cb4 Showing diff from parent 67064c1e930b Diff from another changeset...
@@ -85,13 +85,14 @@ return fmt.Errorf("unable to contact Kiln: %v\n", err)
}
var errors map[string][]KilnError
- err = json.Unmarshal(resp, &errors)
- if err == nil {
+ if err = json.Unmarshal(resp, &errors); err == nil {
if err, _ := errors["errors"]; len(err) > 0 {
return fmt.Errorf("failed: %v\n", err[0].Description)
}
}
- k.credentials.Token = string(resp)
+ if err = json.Unmarshal(resp, &k.credentials.Token); err != nil {
+ return fmt.Errorf("failed to parse token: %v", err)
+ }
return nil
}
|
Loading...