Skip to content

Commit

Permalink
refactor: remove calls to fatal in personal capital client
Browse files Browse the repository at this point in the history
  • Loading branch information
will7200 committed May 31, 2021
1 parent 56e7832 commit fce0562
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 0 additions & 2 deletions pkg/personalcapital/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ func (a *Accounts) GetAccounts(ctx context.Context, request *GetAccountsRequest)
baseURL := a.client.cfg.Host
client := a.client.cfg.HTTPClient
csrf := *a.client.CSRF
log := a.client.cfg.Logger

var urlBuffer bytes.Buffer
urlBuffer.WriteString(baseURL)
Expand Down Expand Up @@ -171,7 +170,6 @@ func (a *Accounts) GetAccounts(ctx context.Context, request *GetAccountsRequest)
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Sugar().Fatal(err)
return nil, err
}
update := GetAccountsResponse{}
Expand Down
4 changes: 1 addition & 3 deletions pkg/personalcapital/holdings.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (h *Holdings) GetHoldings(ctx context.Context, params *GetHoldingsParams) (
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
h.client.cfg.Logger.Sugar().Fatal(err)
return nil, err
}
ghr := GetHoldingsResponseExpecting{}
err = json.Unmarshal(body, &ghr)
Expand Down Expand Up @@ -265,7 +265,6 @@ func (h *Holdings) UpdateHoldings(ctx context.Context, holding HoldingsUpdateReq
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
h.client.cfg.Logger.Sugar().Fatal(err)
return nil, err
}
update := UpdateHoldingsResponse{}
Expand Down Expand Up @@ -372,7 +371,6 @@ func (h *Holdings) AddHolding(ctx context.Context, holding *HoldingAddRequest) (
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
h.client.cfg.Logger.Sugar().Fatal(err)
return nil, err
}
update := AddHoldingResponse{}
Expand Down

0 comments on commit fce0562

Please sign in to comment.