Skip to content

Commit

Permalink
Merge pull request #30 from LUSHDigital/feature/missing-error-handling
Browse files Browse the repository at this point in the history
missing error handling in extract data
  • Loading branch information
codingconcepts authored Aug 21, 2018
2 parents 9e804b7 + 91a78c4 commit 74c2a8b
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 74c2a8b

Please sign in to comment.