Skip to content

Commit

Permalink
missing error handling in extract data
Browse files Browse the repository at this point in the history
  • Loading branch information
ladydascalie committed Aug 21, 2018
1 parent 9e804b7 commit 91a78c4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions response/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ func (r *Response) ExtractData(srcKey string, dst interface{}) error {
}

// Decode the raw JSON.
json.Unmarshal(rawJSON, &dst)
if err := json.Unmarshal(rawJSON, &dst); err != nil {
return err
}
}

return nil
Expand Down Expand Up @@ -240,7 +242,9 @@ func (p *PaginatedResponse) ExtractData(srcKey string, dst interface{}) error {
}

// Decode the raw JSON.
json.Unmarshal(rawJSON, &dst)
if err := json.Unmarshal(rawJSON, &dst); err != nil {
return err
}
}

return nil
Expand Down

0 comments on commit 91a78c4

Please sign in to comment.