Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #8 from Brightscout/MI-380
Browse files Browse the repository at this point in the history
Check for error before writing new file in client.Store()
  • Loading branch information
gulien authored Oct 9, 2019
2 parents 6de9f02 + 6e3fdda commit 921a34c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ func (c *Client) Store(req Request, dest string) error {
return err
}
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK {
return errors.New("failed to generate the result PDF")
}
return writeNewFile(dest, resp.Body)
}

Expand Down

0 comments on commit 921a34c

Please sign in to comment.