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

Commit 921a34c

Browse files
author
Julien Neuhart
authored
Merge pull request #8 from Brightscout/MI-380
Check for error before writing new file in client.Store()
2 parents 6de9f02 + 6e3fdda commit 921a34c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

client.go

+4
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ func (c *Client) Store(req Request, dest string) error {
9494
return err
9595
}
9696
defer resp.Body.Close()
97+
98+
if resp.StatusCode != http.StatusOK {
99+
return errors.New("failed to generate the result PDF")
100+
}
97101
return writeNewFile(dest, resp.Body)
98102
}
99103

0 commit comments

Comments
 (0)